You use the CREATE DATABASE command to create a new database. To create a new database named newdb, issue the following command. The output will be as shown if the database is created successfully.
mysql> CREATE DATABASE newdb; Query OK, 1 row affected (0.02 sec)
Usually you execute this command when you are connected as the root user, but you can create databases when logged in as any user who has the CREATE privilege. You will learn more about the privilege system in MySQL in Lesson 18, “Managing User Access.”
The database name can be up to 64 characters in length and can contain any character that ...