...
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.

step1:
Go to the command Prompt.

step2:

 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)

step3:

 Create database my_db;

step4:

 use my_db;

step5:

 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