Reputation: 27689
How to backup the mysql binary files?
When executing this in the command line it prompts for a password even if its mentioned in the syntax.. After typing in the password an error is returned saying that the database (the password) is unkown.. password and database is swapped in the syntax???
syntax
mysqldump --opt -h localhost -u USER -p PASSWORD DB | gzip > /var/mysql_backup.gz
error
mysqldump: Got error: 1049: Unknown database 'PASSWORD' when selecting the database
exec('/usr/bin/mysqldump --opt -h localhost -u USER -pPASS DB | gzip > /var/mysql_backup.gz', $rtn, $err);
echo 'rtn = ';
print_r($rtn);
echo 'err = ';
print_r($err);
Upvotes: 0
Views: 2545
Reputation: 270609
Try it without a space after -p
:
mysqldump --opt -h localhost -u USER -pPASSWORD DB | gzip > /var/mysql_backup.gz
Upvotes: 3