Home > Database > Mysql Tutorial > What statement is used to create a database in mysql

What statement is used to create a database in mysql

下次还敢
Release: 2024-04-05 19:33:15
Original
1078 people have browsed it

What statements are used to create a database in MySQL?

To create a database in MySQL, you can use the CREATE DATABASE statement.

Syntax

<code>CREATE DATABASE database_name;</code>
Copy after login

Parameters

  • database_name: The name of the database to be created (identifier).

Example

To create a database named "mydb", you can use the following statement:

<code>CREATE DATABASE mydb;</code>
Copy after login

After executing this statement, The "mydb" database will be created.

Note

  • Database names are case-sensitive.
  • Before creating a new database, you need to connect to the MySQL server. The
  • CREATE DATABASE statement can only be executed by a user with appropriate permissions, such as the CREATE permission.

The above is the detailed content of What statement is used to create a database in mysql. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template