1、進入數(shù)據(jù)庫
mysql [-h服務器地址] [-u用戶名] [-p口令] [數(shù)據(jù)庫名]

image.png
在本機就不需要輸入服務器地址了
2、查詢所有數(shù)據(jù)庫
mysql> show databases;

image.png
3、進入數(shù)據(jù)庫(test)
mysql>use test;
4、查詢所有的表
mysql>show tables;
5、查詢表數(shù)據(jù)
mysql>select * from 表名;
6、查看表結構
mysql>show columns from 表名;
7、退出
mysql>exit;