创建数据库:
输入:CREATE DATABASE itcase;
计算机输出:
计算机输出:
Query OK, 1 row affected
查看数据库:
输入:SHOW DATABASES;
计算机输出:
输入:SHOW DATABASES;
计算机输出:
+--------------------+
| Database |
+--------------------+
| information_schema |
| itcast |
| mysql |
| performance_schema |
| test |
+--------------------+
5 rows in set
查看创建数据库的方式:
输入:SHOW CREATE DATABASE itcast;
计算机输出:
| 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;
计算机输出:
| 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;
计算机输出:
+----------+-----------------------------------------------------------------+
| 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
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set