Using mysqldump to backup a database
mysqldump is quite a nice program for downloading and SQL dump from a mysql server. It's quite easy to use. Here's a basic mysqldump usage for backing up a database.
mysqldump -u username -p your_database > your_database_backup.sql Enter password:
-ufor the usernameyour_databaseis the database name that you will backupyour_database_backup.sqlwill be the file name where the backup will be saved
Options
Here are a few options you could check:
-vVerbose mode. Print more information about what the program does.-XWrite dump output as well-formed XML.
The script above logins using your provided username and password and downloads a dump from your_database and save it on your_database_backup.sql file
Categories: Web Development
Tags: mysqldump
No Comments