1. Database operations:
1.1 Creating databases: Create databases < database names >
A. Creating a database named Oldboy_default
mysql> CREATE DATABASE Oldboy_default;
B. View the statement that built the library:
Mysql>show CREATE DATABASE Oldboy_default;
C. Establishment of a GBK character set database named OLDBOY_GBK
Mysql>create database OLDBOY_GBK default character set GBK COLLATE gbk_chinese_ci;
Method 2: By creating the default database method: Mysql>create "Oldboy ' default character set GBK;
2. Deleting a database
Command: Drop databases < database name >
For example, delete a database named Oldboy. Mysql>drop;
3. Connect to the database
Command: Use < database name >
Mysql> Select Database ();
3.1 table information contained in the current database
Mysql> Show tables;
Mysql>show tables from OLDBOY_GBK; #查看指定库中的表
3.2 Delete System extra account: Drop user "user" @ "host Domain"
Mysql>drop user ' root ' @ ' Oldboy '
3.3 Create a user and give permissions
3.4 Recommendations for authorized users in production environments
4 table operation
4.1 Production environment Standard UTF8 format table Structure statement
Mysql field Type:
4.2 Create a table:
4.2.1 to create an index for a field:
5. Insert Data:
5.1 Bulk INSERT Data:
6. Database backup:
7. Querying data
7
8. Modify the data in the table:
9. Multi-Table query:
10. Delete the data from the table:
11. Adding and removing fields from the table:
12 Change Table Name: Command: Rename table name to new table name
13 Delete Table: Command: Drop table < table name >
MySQL Common command operation of the increase and deletion check