Database Basics 3 (MySQL syntax)

Source: Internet
Author: User

4 Database Management (last chapter) 4.1 querying all databases

mysql> show databases;

+--------------------+

| Database |

+--------------------+

|     Information_schema | --MySQL metadata, basic data

|    MySQL | --mysql The configuration database, which contains user information. (User name and password, rights Management)

|    Performance_schema | --mysql Database software operation data, log information, performance data

|     Test | -- test the database. The Empty

+--------------------+

4 rows in Set (0.00 sec)

4.2 Creating a database

Mysql> CREATE Database Day15-- Specify the default character set for creating databases

--Default character set UTF8

;

Query OK, 1 row Affected (0.00 sec)

4.3 Viewing the default character set for a database

Mysql> Show CREATE Database day15;

+----------+----------------------------------------------------------------+

| Database | Create Database |

+----------+----------------------------------------------------------------+

| DAY15 | CREATE DATABASE ' day15 '/*!40100 DEFAULT CHARACTER SET UTF8 */| |

+----------+----------------------------------------------------------------+

1 row in Set (0.00 sec)

4.4 Deleting a database

mysql> drop Database day15;

Query OK, 0 rows affected (0.01 sec)

4.5 Modifying a database

mysql> ALTER DATABASE DAY15 default character set GBK;

Query OK, 1 row Affected (0.00 sec)

Database Basics 3 (MySQL syntax)

Related Article

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.