How to import database dump from mysql console

Import Database:-

If the size of the DB dump is large than instead of using PHPMYADMIN for importing database, you can go for the mysql console.
Here I am mentioning  steps to import the Database:-
1. Start the Server which ever you are using. For examples wamp, xamp, lamp.

2. Open mysql console. It will ask for the password. Enter the password. If you do not use password, leave blank, and just hit enter.

3. Run the following command.
    mysql>show databases; // It will list all the databases

4. Now for selecting any particular database, run the following command.
    mysql>use databasename; //Mention you db name here

5. Now Run last command to import database.
    mysql>source path_to_sql_file.sql; // Ex.  mysql>source D:\my_sql_file.sql 

No comments:

Post a Comment