ngecoding.com logo

Mysql Database Backup with Mysqldump

//if(youLikeIt || itHelpsYou)clickShare();

Mysql provides mysqldump to backup database to text file.

Type this command in your terminal (or CMD on windows)

mysqldump

The output should be like this.

Usage: mysqldump [OPTIONS] database [tables]
OR     mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR     mysqldump [OPTIONS] --all-databases [OPTIONS]
For more options, use mysqldump --help

If your output is different, move your terminal directory to <mysql_installation_path>/bin and try again.

 

This is default command for mysqldump

mysqldump -uusername -ppassword database_namepath_backup

Example :

mysqldump -uroot -p123456 db_employee > /home/backup/employee.sql

This will generate employee.sql file that contains db_employee schema and data.

 

If your database contains storedprocedures and functions, use --routines option.

mysqldump -uroot -p123456 --routines db_employee > /home/backup/employee.sql

 

//if(youLikeIt || itHelpsYou)clickShare();
//Advertisements
Take a Break //non-technical articles
Hot Topics //most used tags
Email Subscriptions //We won't spam you. Honest!

Enter your email address:

Delivered by FeedBurner