Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restore mysql database in XAMPP?

I have a backup of the entire xampp/mysql folder. How can I use it to recover my old db on a fresh installation of XAMPP?

Simply copying the old xampp/mysql folder to new xampp leads to mysql errors like:

InnoDB: Table veno/sls37_finder_links_termsc in the InnoDB data dictionary has tablespace id 1171, but tablespace with that id or name does not exist. Have you deleted or moved .ibd files? This may also be a table created with CREATE TEMPORARY TABLE whose .ibd and .frm files MySQL automatically removed, but the table still exists in the InnoDB internal data dictionary.

like image 477
van_folmert Avatar asked Dec 20 '22 05:12

van_folmert


1 Answers

To restore your database to XAMPP these are the things you need: -.frm , .ibd files , and ibdata1 can be found in mysql/data folder

Steps

  • Install New XAMPP

  • Replace ibdata1 in mysql/data

  • Copy the folders of the database you want to restore [.frm and .ibd] and paste in mysql/data

  • Run the mysql and Viola it works!

If there is an #1932 error occur, just import the create_tables.sql from xampp/phpMyAdmin/sql and this solves the problem.

like image 146
andread Avatar answered Dec 28 '22 07:12

andread