1.1 创建库

  1. create database if not exists 库名【 character set 字符集名】;
  2. #案例:创建库Books
  3. CREATE DATABASE IF NOT EXISTS books ;

1.2 修改库

alter database 库名 character set 字符集名;
#案例:更改库的字符集
ALTER DATABASE books CHARACTER SET gbk;

1.3 删除库

drop database 【if exists】 库名;
#案例:库的删除
DROP DATABASE IF EXISTS books;