Articles: A Solution for mysqldump: Got errno 32 on write
Posted by: david on 08/22/2011 - 01:20 PM
I was using mysqldump to backup mysql data from one server to another. It was working well until recently after I added a few more lines to my command line backup script- basically to backup more tables. In the script I have individual lines to backup single tables in this example format:mysqldump -uusername -ppassword -hsource_server --compress --skip-lock-tables --lock-tables=false database_to_backup table_to_backup | mysql -uusername_of_local_server -ppassword_of_local_server name_of_local_database
Whenever cron ran the script, I was getting the error:
ERROR 1049 (42000): Unknown database 'database_to_backup'
mysqldump: Got errno 32 on write
It turned out that I had a typo for the name of the local database which did not exist. Basically my destination database has a different name than the database to be backed up, but I still used the same name. Dumb-dee-dum-dumb. So if you are having this error double check your spelling/existence of the local target database you are doing the backup to!