1

I need to copy over a large mysql database with myisam tables. The fastest way for me to do it is by copying over the mysql/data directory. The .MYI and .MYD files copy over smoothly. However, copying the .frm file is causing mysql to show an error when I query the database. :

#1033 - Incorrect information in file: 'mytable.frm' 

When I did the copy I stopped the mysql server. Also, I made sure that the owner and permissions are set correctly. The repair table command wouldn't work either because of the same aforementioned error. What am I doing wrong here?

(A possible solution would be to do a mysqldump of just the data structure which would be a fast process and then I would only need to copy over the .MYI and .MYD files. However, I would like to know what I am doing wrong with the copy before I go on a more complicated route)

Update

Following up on @RickJames comments - Here is a more detailed explanation of what I am doing:

I'm using cp command on a Linux server to copy files from one db to another db on the same server. The version that I am using mysql Ver 14.12 Distrib 5.0.77 did not work. Inspired by @RickJames comment, I tried doing the same operation on a different server with mysql Ver 14.14 Distrib 5.6.29 and it worked beautifully. That being said, I'm still intrigued as to why it doesn't work with the older version

Shlomo
  • 43
  • 1
  • 6
  • What tool was used for the copy? From what OS to what? – Rick James May 08 '17 at 19:59
  • @RickJames I'm using cp command on a Linux server to copy files from one db to another db on the same server. – Shlomo May 08 '17 at 21:32
  • Hmmm... Nothing _should_ have gone wrong with the `.frm` in an intra-server `cp`. The `.frm`. is _rarely_ in an state that could lead to your symptom. What version of MySQL in both cases? – Rick James May 08 '17 at 23:19
  • @RickJames See update to question – Shlomo May 09 '17 at 14:14
  • 1
    I would expect cp in 5.0 to 5.0 to work. I would worry about jumping 3 major versions (over 5.1 and 5.5) to get to 5.6. There have been significant changes over that time. Sorry, I am still stumped. – Rick James May 09 '17 at 15:10
  • Did you check to see that the version of the source mysql database matches the target mysql database? – Sam Goldberg May 10 '17 at 11:49

0 Answers0