1.查看所有的库.
mysql> show databases;
2.终止命令,一定要打在;号前面.
mysql> show databases\c;
3.创建库,(个人认为,创建的本质是由一维,注入能量,转化为多维,而删除的本质暂且抽象为释放,或者能量输出,多维转化为一维)
mysql> create database ZhangHui;(注意,命令和格式要正确)
Query OK, 1 row affected (0.00 sec)
4.查看创建库的语句.
mysql> show create database GeXiaorui;
+-----------+--------------------------------------------------------------------+
| Database | Create Database |
+-----------+--------------------------------------------------------------------+
| GeXiaorui | CREATE DATABASE `GeXiaorui` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+-----------+--------------------------------------------------------------------+
1 row in set (0.00 sec)
5.创建库,指定字符集utf8(这样就可以识别中文了)
mysql> create database ZhangWenting default charset utf8;
6.查看当前所在库;
mysql> select database();
+------------+
| database() |
+------------+
| NULL |(表示,当前没有进入任何库)
+------------+
1 row in set (0.01 sec)
7.进入某个库;
mysql> use GeXiaorui;
Database changed
mysql> select database();
+------------+
| database() |
+------------+
| GeXiaorui |
+------------+
1 row in set (0.00 sec)
love you little ,love you long.
8.删除库.(目前ZhangHui的库,没有指定字符集,所以要删除重建)
mysql> drop database ZhangHui;
因为该库没有指定字符集.
海明威-老人与海
网友评论