Friday, March 14, 2008

How can I backup a MySQL database?

/path/to/bin/mysqldump -u $mysqlusername -p$mysqlpassword $mysqldatabasename > backup.sql OR: mysqldump -u user -p --opt database > backup_file
Not that there is no space after the -p . If the password was "pass" you would use -ppass

No comments: