Create Database statement Introduction MySQL DBA Weekend Study

Source: Internet
Author: User
Tags dba

The CREATE DATABASE statement creates a DB with the specified name on the MySQL instance, and when the created database itself exists and does not specify an if NOT EXISTS clause, the statement creating the database will error.

The created database creates a directory of its own files in the same directory as the data file, which is used to contain the table files that are created later. Of course, you can also create a folder in the data directory through MKDIR's operating system commands, and MySQL will recognize it as a database and be seen when you execute the show databases command .

mysql> CREATE database test3; # #创建数据库成功

Query OK, 1 row Affected (0.00 sec)

mysql> CREATE database test3; # #再次创建数据库失败

ERROR 1007 (HY000): Can ' t create database ' test3 '; Database exists

mysql> CREATE database if not exists test3; # #语句执行成功

Query OK, 1 row affected, 1 Warning (0.00 sec)

mysql> use test3; # #切换到test3数据库

Most of the databases used by internet companies are MySQL , want to stand out from the many IT workers, need to have advanced technology, learning to add value is essential. The way of learning is your insistence. the old boy education MySQL DBA course, after several updates the course, put an end to the paper , the whole enterprise real case unifies the theory instruction, wants to study the MySQL dba 's knowledge deeply, Can pay attention to the old boy education.


Create database statement about MySQL DBA Weekend learning

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.