Create database

Time:2021-1-21

Create database

After the installation of MySQL, several required databases will be automatically created in the data directory. You cansql
sql
SHOW DATABASES;
Statement to view all existing databases. The input statement is as follows.
As you can see, there are six databases in the database list. MySQL is a must. It describes the user‘s access rights. Users often use test database to do testing work. Other databases will be introduced in later chapters.
To create a database is to divide an area on the system disk for data storage and management

CREATE DATABASE database_name;

“database_ “Name” is the name of the database to be created, which cannot be the same as the existing database.
Create test database_ DB, the input statement is as follows.

CREATE DATABASE test_db;

After the database is created, it can be usedsql
sql
SHOW CREATE DATABASE;
View the definition of the database.
View the created database_ The definition of DB is as follows.

SHOW CREATE DATABASE test_db\G;

This work adoptsCC agreementReprint must indicate the author and the link of this article

Recommended Today

Don’t be a tool man. Touching hands teaches you Jenkins!

Hello everyone, I’m a piece of cake, a piece of cake eager to be Cai Bucai in the Internet industry. Soft or hard, praise is soft, white whoring is just!Ghost ~ remember to give me a third company after watching it! This article mainly introducesJenkins If necessary, please refer to If it helps, don’t forgetgive […]