练习
1、创建库ShaoLina,指定字符集为utf8
create database ShaoLina defaultcharset=utf8;
2、进入到库ShaoLina
use ShaoLina;
3、查看当前所在的库
select database();
4、查看库中已有的表
show tables;
5、查看AID01的默认字符集(创建库的语句)
show create database ShaoLina;
6、删除库ShaoLina
drop database ShaoLina;
实操:
mysql> create database ShaoLina default charset=utf8;
Query OK, 1 row affected (0.00 sec)
mysql> use ShaoLina;
Database changed
mysql> select database();
+------------+
| database() |
+------------+
| ShaoLina |
+------------+
1 row in set (0.00 sec)
mysql> show tables;
Empty set (0.00 sec)
mysql> show create database ShaoLina
-> \c
mysql> show create database ShaoLina;
+----------+-------------------------------------------------------------------+
| Database | Create Database |
+----------+-------------------------------------------------------------------+
| ShaoLina | CREATE DATABASE `ShaoLina` /*!40100 DEFAULT CHARACTER SET utf8 */ |
+----------+-------------------------------------------------------------------+
1 row in set (0.00 sec)
曹雪琴
网友评论