How to export mysql database in command mode ?

by   SJRANJAN

“mysqldump” program is used to export or copy or back up databases and tables. mysqldump writes exported database sql into a specified file.

How to use ?
* Login to mysql in command mode.
* Use the following syntax to export your database.
      mysqldump -u MYSQL_USER -p DATABASE_NAME EXPORTED_FILENAME
Once you executed above command, you will be prompted to enter your mysql password. Once you entered correct password your database will be exported as the specific file.
Example
Consider your MySql username is “root” and Password is NULL and database name is “students”, you have to enter command like following to export your database.
      mysqldump -u root -p students > students.sql
Once you entered this command you will be prompted to enter your password. Simply press Enter Key. Your database ‘students’ will be exported as students.sql in your root folder.
Share on :