Export MySQL Database Using Command Line
Steps we are using in this article to export MySQL database using the command line:
- Open Command Prompt
- Navigate to the MySQL Bin Directory
- Use the mysqldump Command
- Enter Your Password
- Verify the Export
1. Open Command Prompt
Open the Command Prompt by pressing Win + R or typing cmd, and hitting Enter.
2. Navigate to the MySQL Bin Directory
If mysql and mysqldump commands are not in our system’s PATH, navigate to the MySQL bin directory. This is usually located at:
cd C:\Program Files\MySQL\MySQL Server X.Y\bin
Replace X.Y with our MySQL version.
Example:
We can see in the below image that my version is 5.7. So the syntax becomes:
cd C:\Program Files\MySQL\MySQL Server 5.7\bin
How to Export MySQL Database using Command Line?
Exporting MySQL databases using the command line utility in Windows is a knowledge every Database Administrator and developer should possess. The mysqldump utility is an easy-to-use program that can back up databases, replicate or transfer data from one server to another and migrate databases.
In this article, We will outline how to back up one database, multiple databases and particular tables in a database using the Windows Command Prompt in detail.