How to export a mysql database using Command Prompt?

To export a MySQL database using Command Prompt, you can use the following steps:

  1. Open Command Prompt and navigate to the directory where the MySQL executable is located.
  2. Connect to the MySQL server by typing the following command:
mysql -u [user name] -p

3. Enter your password when prompted.

4. Select the database you want to export by typing the following command:

USE [database name];

5. Export the database by typing the following command:

mysqldump -u [user name] -p [database name] > [file name].sql

6. Enter your password when prompted. The exported SQL file will be saved in the current directory with the specified file name.

Note: Replace the values in square brackets with the actual values for your setup.

Leave a Comment