1. Create a database:
Data definition language (DDL);
Create DATABASE db_name[databases option]
Note: Database naming rules: Capitalization depends on the current operating system, see name, recommended underline
Character of the identifier:
Use any character, number, symbol, or even Chinese. But some special combinations, such as a combination of pure numbers, special symbols, including keys inside MySQL, should be wrapped with an identifier qualifier
Qualifier: Anti-quote
Chinese is also possible: but requires the client to encode
2. Querying a database that has already been created
show databases; (View show all databases)
Show Create Database db_name; ( view shows specific data)
3. Deleting a database
Drop database db_name; (irreversible, use caution)
4. Modify the Database
ALTER DATABASE db_name;
Note: Modify the name of the database
(1) Simple, directly modify the file directory;
(2) Export the data of the database, create a new database, import the data content, delete the old database;
(3) Create a new database that will move (rename) all the tables in the old database to the new database and delete the old database.
MySQL (3): Database operations