首页 > 数据库技术 > 详细

MYSQL第二课

时间:2019-10-20 21:11:30      阅读:61      评论:0      收藏:0      [点我收藏+]
创建数据库:
输入: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

MYSQL第二课

原文:https://www.cnblogs.com/zmh0227/p/11708388.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!