MySQL Common command operation of the increase and deletion check

Source: Internet
Author: User
Tags bulk insert

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.