Mysql – Identify MySQL create version from data files

MySQL

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?

Best Answer

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: