How to export a mysql database using Command Prompt?

Starx picture Starx · Jun 13, 2010 · Viewed 670.5k times · Source

I have a database that is quite large so I want to export it using Command Prompt but I don't know how to.

I am using WAMP.

Answer

Starx picture Starx · Jun 13, 2010

First check if your command line recognizes mysql command. If not go to command & type in:

set path=c:\wamp\bin\mysql\mysql5.1.36\bin

Then use this command to export your database:

mysqldump -u YourUser -p YourDatabaseName > wantedsqlfile.sql

You will then be prompted for the database password.

This exports the database to the path you are currently in, while executing this command

Note: Here are some detailed instructions regarding both import and export