How to export database dump from mysql console

Export Database:-

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

2. Open Command Prompt(cmd) not Mysql Console.

3. Now run the following cammand and change the directory to following path.
    C:\>cd wamp\bin\mysql\mysql5.1.36\bin // please check your working directory(C or D)
                                                                         and change accordingly in path.
4. Hit Enter. You will see path like this.
    C:\wamp\bin\mysql\mysql5.1.36\bin>

5. Run following command.
   mysqldump -u username -p db_name>sql_file_path_name
   For Ex: mysqldump -u root -p hemant>D:\sqlfile.sql  
   // You do not need to create sql file in any drive. Just mention the path in command line like above example, Sql file will be created automatically.

6. Hit enter, It will ask for the password.if you do not use password for mysql, just leave it and hit enter.

Note :- Please wait till the cursor is blinking(when database size is huge). 

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