How Do I Create a New Database in MySQL
This blog will provide the process to make a new database using a terminal in MySQL.
How to Create/Make a New Database Using Terminal in MySQL?
You can create/make a new database by utilizing the terminal in MySQL. Follow the below-given instructions:
- Launch the Windows terminal.
- Connect the terminal with the MySQL server.
- Display the existing databases.
- Use the “CREATE DATABASE <new-databasename>” command.
- Verify New Database
Step 1: Launch Windows Terminal
At first, search the “Command Prompt” with the help of the Startup menu:
Step 2: Connect Terminal With MySQL
Run the provided command to connect the terminal with the MySQL server by utilizing the following command:
Step 3: Display Databases
Now, view the list of all existing databases by executing the “SHOW” command:
Step 4: Create New Database
Finally, create a new database by utilizing the “CREATE” command with the “DATABASE” option and database name:
As you can see, the new database has been created successfully:
Step 5: Verify New Database
Lastly, use the “SHOW” command to view the list of databases and ensure that the new database created or not:
As you can see, “mynewdb” exists in the list:
That’s all! We have provided the procedure to create a new database in MySQL using a Windows terminal.
Conclusion
To create a new database in MySQL using the terminal, first, launch the Windows terminal and connect with the MySQL server. Then, display the existing databases and execute the “CREATE DATABASE <new-databasename>” command. This blog illustrated the method to create/make a new database in MySQL using the terminal.
Source: linuxhint.com