查看MySQL中的数据库:
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sakila |
| test |
| world |
+--------------------+
6 rows in set
创建数据库:
mysql> create database learnsql;
Query OK, 1 row affected
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| learnsql |
| mysql |
| performance_schema |
| sakila |
| test |
| world |
+--------------------+
7 rows in set
进入数据库:
mysql> use learnsql;
Database changed
查看数据库表:
mysql> show tables;
Empty set