命令: show databases;
效果演示:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| bjpowernode |
| dbtest1 |
| detest2 |
| display |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
8 rows in set (0.00 sec)
命令:use 数据库名;
效果演示:
mysql> use bjpowernode;
Database changed
命令:show tables;
效果演示:
mysql> show tables;
+-----------------------+
| Tables_in_bjpowernode |
+-----------------------+
| bjpowernode |
| dept |
| emp |
| salgrade |
+-----------------------+
4 rows in set (0.00 sec)
命令: desc 表;
mysql> desc dept;
+--------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+-------------+------+-----+---------+-------+
| DEPTNO | int | NO | PRI | NULL | |
| DNAME | varchar(14) | YES | | NULL | |
| LOC | varchar(13) | YES | | NULL | |
+--------+-------------+------+-----+---------+-------+
3 rows in set (0.01 sec)