3.mysql Database Operations

Source: Internet
Author: User

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

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.