Database Operations and database operation statements

Source: Internet
Author: User

Database Operations and database operation statements
Database Operations create a database

Syntax:

Create database name [charset utf8 ];

Example:

The essence of database creation: a directory with the same name as the database will be created in the directory specified by datadir configuration options in my. ini.

There will be a db. opt text file example in the database directory with the same name:

Note:

Character Set, which is the encoding method used to store Databases

A verification set is a comparison rule in a character set.

Example of datadir in my. ini:

 

View Database

View All databases

Syntax:

Show databaseS;

Example:

Database test, which can be deleted

Mysql database, mysql core database, and msyql are used to manage databases of other databases.

We recommend that you do not modify the data in it easily.

The information_schema database records information about mysql used to manage other databases.

Performance_schema database, a performance database, mainly records the running information of the server.

 

View database creation statements

Syntax;

Name of the show create database;

Example:

 

Modify Database

Only character sets and verification sets can be modified.

Alter database name charset Character Set;

Example:

Delete Database

Syntax:

Drop database name;

Example:

Example:

 

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.