1

I have a script that creates a backup of the production server database (mysql 5.1.66 RHEL) each night, and later in the morning the database is restored to my development computer (mysql 5.6.12 OSX 10.8.4)

the server mysqldump options are:

mysqldump --user=<username> --password=<secret> --opt --net_buffer_length=5000 --hex-blob --add-drop-database --databases [databasename] > file.sql

after copying file.sql to the development computer, the restoring code on the development machine is:

mysql -u<username> -p<secret> -h127.0.0.1 databasename < $sql

This script has worked well for a bit, but today I noticed error:

ERROR 1010 (HY000) at line 22: Error dropping database (can't rmdir './databasename', errno: 66)

I looked up the error code, and found it means = "object is remote", which is not particularly illuminating to me!

BTW I am dropping the database because previously I was getting an error with the INNODB table tablespaces which was:

ERROR 1813 (HY000) at line 25: Tablespace for table '`databasename`.`table`' exists. Please DISCARD the tablespace before IMPORT.

I have seen a post on this forum how to fix the error, but I more interested in understanding what happened so I can prevent it from recurring, as I have the automated script running each day.

Thanks in advance for reading.

Community
  • 1
  • 1
pgee70
  • 3,707
  • 4
  • 35
  • 41
  • So was the TABLESPACE error on your source data box? Those errors can creep in, cause can be anything from insufficient max packet sizes along with logfile sizes while a rollback is attempted, to ibd corruption from crash, lack of privs on datafile etc. If you explicitly call DROP DATABASE yourdb on your dev box do you receive the same error? That will be helpful in cause/prevention. – cerd Aug 11 '13 at 03:28
  • Hi. I re-installed mysql 5.5 and so far it has been working as it should. I was wasting too much time fixing, so I just want a solution that works. – pgee70 Aug 19 '13 at 10:31
  • Did you do a hard shutdown on your computer (just unplug the power cord)? Seems to be a regression in 5.6 compared to 5.5. – Josh Unger Sep 04 '13 at 19:18
  • no, i never unplugged the cord. i had a script that was overwriting the database/s each day with the most recent copy from the production database. since i went back to 5.5 it has been working well. – pgee70 Sep 10 '13 at 12:34

0 Answers0