MySQL从小白到总裁完整教程目录:https://blog.csdn.net/weixin_67859959/article/details/129334507?spm=1001.2014.3001.5502
语法格式:
show create database 数据库名称;
案列:查看testing数据库信息
mysql> show create database testing;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| testing | CREATE DATABASE `testing` /*!40100 DEFAULT CHARACTER SET gbk */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec)
练习:查看当前有多少个数据库
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bd_ecshop |
| mysql |
| performance_schema |
| test |
| testing |
+--------------------+
6 rows in set (0.01 sec)
一共有六个数据库
查看一下数据库名称为MySQL的数据库的字符集是什么
mysql> show create database mysql;
+----------+------------------------------------------------------------------+
| Database | Create Database |
+----------+------------------------------------------------------------------+
| mysql | CREATE DATABASE `mysql` /*!40100 DEFAULT CHARACTER SET latin1 */ |
+----------+------------------------------------------------------------------+
1 row in set (0.00 sec)
字符集是Latin1
比如说我把数据库名写错,它会怎么显示
mysql> show create database mysql222;
ERROR 1049 (42000): Unknown database 'mysql222'
练习:创建一个数据库名称为czwbkl,字符集为utf8 数据库的全名是橙子味冰可乐的缩写,以后经常会用到,哈哈哈文章来源:https://www.toymoban.com/news/detail-707045.html
mysql> create database czwbkl charset utf8;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bd_ecshop |
| czwbkl |
| mysql |
| performance_schema |
| test |
| testing |
+--------------------+
7 rows in set (0.00 sec)
mysql> show create database czwbkl;
+----------+-----------------------------------------------------------------+
| Database | Create Database |
+----------+-----------------------------------------------------------------+
| czwbkl | CREATE DATABASE `czwbkl` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+-----------------------------------------------------------------+
1 row in set (0.00 sec)
文章来源地址https://www.toymoban.com/news/detail-707045.html
到了这里,关于查看创建好的数据库的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!