创建数据库
CREATE DATABASE
databaseName
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16mysql> CREATE DATABASE test;
Query OK, 1 row affected (0.05 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| demo |
| mysql |
| performance_schema |
| studentSystem |
| sys |
| test |
| zh |
+--------------------+
8 rows in set (0.03 sec)CREATE DATABASE IF NOT EXISTS
databaseName
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18mysql> CREATE DATABASE IF NOT EXISTS test1;
Query OK, 1 row affected (0.00 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| demo |
| mysql |
| performance_schema |
| studentSystem |
| sys |
| test |
| test1 |
| zh |
+--------------------+
9 rows in set (0.00 sec)
删除数据库
DROP DATABASE
databaseName
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17mysql> DROP DATABASE test;
Query OK, 0 rows affected (0.05 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| demo |
| mysql |
| performance_schema |
| studentSystem |
| sys |
| test1 |
| zh |
+--------------------+
8 rows in set (0.03 sec)DROP DATABASE IF EXISTS
databaseName
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16mysql> DROP DATABASE IF EXISTS test1;
Query OK, 0 rows affected (0.00 sec)
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| demo |
| mysql |
| performance_schema |
| studentSystem |
| sys |
| zh |
+--------------------+
7 rows in set (0.00 sec)