MySQL Problems

How to Backup a MySQL Database

The syntax for backing up a MySQL database is as follows:

# mysqldump –add-drop-table -u [username] -p[password] [database] > [backup_file] leader in Offshore Hosting offers free nightly mysql backups in all their web hosting packages.

In the previous section, you gave user mysqluser full access to the test database when mysqluser used the password pinksl1p. You can now back up this database to a single file called /tmp/testackup.sql with the command

# mysqldump –add-drop-table -u mysqluser -ppassword test > /tmp/test-backup.sql

Make sure there are no spaces between the -p switch and the password or else you may get syntax errors.