MySQL, Tutorials

Create & import Database using command prompt

09 April 2019

Here is the steps for Create Database & import sql file into the database from command prompt.

Go to the command Prompt.


 mysql -u root -p 

(if ‘mysql’ is not recognized as an internal or external command error comes then see documentation for setting up your environment variable for mysql)


 Create database my_db;


 use my_db;


 source file.sql;

(note: here you have to specify your source .sql file path for instead of “file.sql”)

For example,

source file import

Now You can see the import process executes queries.

That’s All. Done.

Leave a Comments