第04讲 mysql数据库操作指令

关于操作数据库的三个方法


第04讲 mysql数据库操作指令_第1张图片
image.png

1、显示当前数据库

mysql>show databases;

2、显示数据库创建语句

mysql>show create database db1;

mysql> show create database db1;
+----------+--------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------+
| db1 | CREATE DATABASE db1 /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+--------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> show create database db2;
+----------+--------------------------------------------------------------+
| Database | Create Database |
+----------+--------------------------------------------------------------+
| db2 | CREATE DATABASE db2 /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+--------------------------------------------------------------+
1 row in set (0.00 sec)

3、删除数据库

mysql> drop database db3;
Query OK, 0 rows affected (1.11 sec)

你可能感兴趣的:(第04讲 mysql数据库操作指令)