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.

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

No comments:

Post a Comment