一.命令 1.mysql -h ip -u root -p -P 3306 -h 后面跟ip地址 -u 后面跟用户名 -p 后面跟密码 -P 后面跟端口号 2.show databases 查询所有数据库 show tables 查询所有表 3.\G 在查询命令后加上 \G 将分行显示数据