創建資料庫: 輸入:CREATE DATABASE itcase;電腦輸出: Query OK, 1 row affected 查看資料庫:輸入:SHOW DATABASES;電腦輸出: + +| Database |+ +| information_schema || itcast || my ...
創建資料庫: 輸入:CREATE DATABASE itcase;
電腦輸出: Query OK, 1 row affected 查看資料庫:
輸入:SHOW DATABASES;
電腦輸出: +--------------------+
| Database |
+--------------------+
| information_schema |
| itcast |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set
查看創建資料庫的方式:
輸入:SHOW CREATE DATABASE itcast;
電腦輸出: +----------+----------------------------------------------------------------+
| Database | Create Database |
+----------+----------------------------------------------------------------+
| itcast | CREATE DATABASE `itcast` /*!40100 DEFAULT CHARACTER SET gbk */ |
+----------+----------------------------------------------------------------+
1 row in set
修改後的資料庫:
輸入:ALTER DATABASE itcast DEFAULT CHARACTER SET utf8;
電腦輸出: Query OK, 1 row affectedSHOW CREATE DATABASE itcast;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| itcast | CREATE DATABASE `itcast` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+-----------------------------------------------------------------+
1 row in set
刪除資料庫:
輸入:DROP DATABASE itcast;
電腦輸出: Query OK, 0 rows affected 查看資料庫: 輸入:SHOW DATABASES;
電腦輸出: +--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set