I. Creating a Database
# # #语法:
# # #create database or CREATE schema
# # #create Database or schema if not EXISTS DB name
###[Specifies the default value]character set sets the character set GBK Simplified Chinese UTF8 Universal Code BIG5 Traditional Chinese
###[Specifies the default value]collate proofing name rules Utf8_bin
# # # #数据库名的限制 cannot be the same name can begin with any letter-number-underscore _-$, but cannot use numbers alone.
# # # #不能使用MySQL的关键字, Windows case insensitive, Linux sensitive, improve portability, all lowercase
Two. View the database
# # #语法
# # #show databases or schemas
# # #like ' mode ' where condition; The like option, which specifies the match pattern where optional options are used to specify the scope criteria for the query
SHOW DATABASES; #显示所有的数据库
SHOW SCHEMAS; #显示所有的数据库
SHOW DATABASES like ' db_% '; #查询只有以db_开头的数据库名
Three. Select a database
# # # #当我们使用MySQL command line client We need to explicitly select a database using the use character and then operate on the database
# # #use Database name
Use DB_TEXT1;
Four. Modify the database
# # #语法
# # #alter Database or schema name
# # #character Set Character Set
# # #collater Proofing Set rules
ALTER DATABASE Db_text1
CHARACTER SET GBK
COLLATE Gbk_chinese_ci;
Five. Deleting a database
# # #语法
# # #drop Database or schema if exists DB name
DROP DATABASE IF EXISTS db_text2;
MySQL database build, view, modify, delete