How to create a new database in MySQL?

To create a new database in MySQL, you need to use the CREATE DATABASE statement.

Here is an example of creating a database named “mydatabase”:

Establish a database called mydatabase.

To specify the character set and collation rules when creating a database, you can use the following syntax:

Create a database named mydatabase with character set utf8 and collation utf8_general_ci.

bannerAds