I've some ibd and frm files. Now I want to import those into mysql database. But its not working. I tried with mysqlfrm but it showing
C:\xampp\mysql\data\example>mysqlfrm --diagnostic -vvv users.frm
# WARNING: Cannot generate character set or collation names without the --server option.
# CAUTION: The diagnostic mode is a best-effort parse of the .frm file. As such, it may not identify all of the components of the table correctly. This is especially true for damaged files. It will also not read the default values for the columns and the resulting statement may not be syntactically correct.
# Reading .frm file for users.frm:
# The .frm file is a TABLE.
# Skipping to header at : 2
# General Data from .frm file:
{'IO_SIZE': 86,
'MYSQL_VERSION_ID': 100334,
'avg_row_length': 0,
'charset_low': 0,
'create_options': 9,
'db_create_pack': 2,
'default_charset': 224,
'default_part_eng': 0,
'extra_size': 16,
'frm_file_ver': 5,
'frm_version': 10,
'key_block_size': 0,
'key_info_length': 33,
'key_length': 505,
'legacy_db_type': 'INNODB',
'length': 12831,
'max_rows': 0,
'min_rows': 0,
'rec_length': 11314,
'row_type': 0,
'table_charset': 224,
'tmp_key_length': 505}
# Skipping to key data at : 56
# Reading key part 0.
# Index (key) Data from .frm file:
{'key_names': ['PRIMARY'],
'keys': [{'algorithm': 0,
'block_size': 0,
'comment': '',
'flags': 0,
'key_length': 8,
'key_parts': [{'field_num': 1,
'key_part_flag': 0,
'key_type': 16896,
'length': 8,
'offset': 2}],
'num_parts': 1}],
'num_key_parts': (1,),
'num_keys': 1}
# Skipping to default data at : 250
# Skipping to keys at : 2e83
# Engine string: InnoDB
# Partition string:
# Skipping to column data at : 2fb4
{'com_length': 64512,
'int_length': 0,
'interval_count': 0,
'interval_parts': 57352,
'n_length': 3840,
'null_fields': 0,
'num_cols': 20,
'pos': 3,
'unknown': 16896}
# Fields per screen = 0
EXCEPTION: unpack requires a string argument of length 1
ERROR: Cannot read column data.
I installed mysqlfrm on windows 10. If anyone know how to solve this, Please let me know. that be a great help.
Thank you
Since you shared
users.ibdanduser.frmI took a shot and recovered the table on a Windows 11 machine. Actually, on "Ubuntu on Windows", so it will work on native Ubuntu.First, get Undrop for InnoDB and compile it.
Drop
users.zipin the current directory -undrop-for-innodb. Unzip it.Now let's recover a table schema from users.frm. I like dbsake tool. It's much better than
mysqlfrm(sorry Oracle, that's true).Here's your schema:
Now, let's fetch records from
users.ibd. First step would be to parse the ibd file and sort InnoDB pages in it.The
stream_parsercreatespages-users.ibd/FIL_PAGE_INDEX/0000000000000367.page. This is a file with InnoDB pages of thePRIMARYindex of theuserstable. Basically, this is where the table records are.Second step is to fetch records from
0000000000000367.page.The command saves records in a file
dumps/default/usersTo load this file into a MySQL instance
c_parseralso generates a helper LOAD statement which I saved inload.sqlThe load command should be something like
If you repeat the steps you should get the same result. If something doesn't work - drop me a line in LinkedIn I will send you the
dumps/default/usersfile.Good luck.