To Create a database :
Create DATABASE [if not exits] DB name [database option];
Description
Database name: can be any character, but special characters need to use anti-quote wrapping, the size of the identifier is used to distinguish the operating system casing characteristics
If not exists indicates that the database does not exist is created
Database options: Contains the database character set (character set UTF8), proofing set (collate utf8_general_ci)
Note: Use show character set; command to view character set
Use show collation; View proofing Sets (collation of character sets)
For example:
Create database user_message character set UTF8;
querying the database :
1. Querying the existing database: show databases [like ' pattern '];
2. Query creation database: show create databases Datebase_name;
Example: show create Database user_message;
To Delete a database :
drop database [if exits] database_name;
For example: Drop database user_message;
Update Database options:
ALTER DATABASE database_name updated table options
Description: Table options are consistent with definition
For example: ALTER DATABASE user_message character set gb2312;
working with Databases :
Use database_name;
3.mysql Database Operations