MySQL Learning (2) Creating and deleting databases

Source: Internet
Author: User

Create a database

{} Required | Select from front and back [] optional

Create {database | schema} [if not EXISTS] db_name [default] Character Set [=] Charset_name

Create a database T1

Create DATABASE T1;

View all databases

Show database;

If not exists (if it does not exist)

When you create the T1 database again, the system prompts that T1 already exists,

But when plus if not exists will overwrite, get a warning

See how the T1 database is encoded

Show CREATE DATABASE T1;

Modify how it is encoded

ALTER DATABASE T1 character set= GBK;

(The Character set section can be re-created without using the default encoding method)

Deleting a database

Dorp {Database|schema} [if exists] db_name

MySQL Learning (2) Creating and deleting databases

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.