1

Someone has given me a copy of a database full of FRM, MYD, and MYI files. Trying to open it in my newer MySQL version gives an error that I need to run mysql_upgrade. I don't want to change the files at all, so I want to install the same version of MySQL that was used to create the database. Is there some way to identify the creation version from looking at these files?

asked Aug 1, 2019 at 19:36
4
  • You might be able to run it with the --upgrade-system-tables option. This should leave the user-defined schemas alone. Please see here: dev.mysql.com/doc/refman/5.7/en/mysql-upgrade.html Always back up the original files first before you run something and you can always restore from the backups if what you try doesn't work. Commented Aug 1, 2019 at 19:48
  • Also, check here: stackoverflow.com/questions/879176/… Commented Aug 1, 2019 at 19:52
  • @raphael75 - That sounds backwards. The frm/myd/myi files in the database probably need fixing, not the system tables. Commented Aug 1, 2019 at 22:00
  • Do you have the mysql schema (user.MYD, user.MYI, ...) ??? Commented Aug 2, 2019 at 13:56

1 Answer 1

4

Open the .frm file with a hex editor. Go to offset 0x33 and read four bytes. Convert to decimal, keeping your endianness in mind.

Examples:

  • c0c30000 --> c3c0 --> 50112 --> version 5.1.12
  • 64c50000 --> c564 --> 50532 --> version 5.5.32
  • b2860100 --> 186b2 --> 100018 --> version 10.0.18 (MariaDB)
  • 19870100 --> 18719 --> 100121 --> version 10.1.21 (MariaDB)

Sources:

answered Aug 2, 2019 at 13:07

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.