| by Arround The Web | No comments

How Do I Create a New Database in MySQL

A database is utilized to save the collection of records in a readable form. It lets users easily hold the data in tables’ columns, rows, and indexes to get similar information. Additionally, users can access and manage the records through the database easily.

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:

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:

mysql -u root -p

Step 3: Display Databases

Now, view the list of all existing databases by executing the “SHOW” command:

SHOW DATABASES;

Step 4: Create New Database

Finally, create a new database by utilizing the “CREATE” command with the “DATABASE” option and database name:

CREATE DATABASE mynewdb;

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:

SHOW DATABASES;

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.

Share Button

Source: linuxhint.com

Leave a Reply