一.查询 库和表信息
mysql> show databases; 查看数据
mysql> use mysql;进入数据库
mysql> show tables; 看当前库中有哪些表
二.查询表内容
mysql> select * from mysql.user; 查看表内容
mysql> desc mysql.user; 查看表结构,可以看到字段类型,以及主键值字段
mysql> select host,user,password from mysql.user; 按照字段查询
mysql> select host,user,password from mysql.user where user="root"; 按条件查询
mysql> select host,user,password from mysql.user where user="root" and host="localhost"; 两个
条件同时满足
mysql> select host,user,password from mysql.user limit 3; 查询3行