68

Xampp error after moving xampp folder:

enter image description here

Apache is running fine:

enter image description here

as given below image i'm sucess to run apache but unable to run mysql if in case i moved and run xampp both apache and mysql but its shows error which is fresh and it show the error like "Table doesn't exist in engine" #1932 as given up image. please solve the issue anyone help pls

1
  • Check whether you have any luck with this post and this post Commented Aug 4, 2016 at 9:07

20 Answers 20

104

Copy the ib_logfileXX and ibdata file from old mysql/data folder to the new mysql data folder and it will fix the issue

Sign up to request clarification or add additional context in comments.

4 Comments

That worked for me. I installed new version of XAMPP and moved mysql/data and htdocs form the old one to newest one. after this problem appears until I followed your instructions. Thanks :)
I did that but the problem still exists
Still works for upgrade from mysql5.7.14 to mariadb10.6.5
What if you deleted the ib_logfileXX files by mistake.
65

I have faced same issue and sorted using below step.

  1. Go to MySQL config file (my file at C:\xampp\mysql\bin\my.ini)
  2. Check for the line innodb_data_file_path = ibdata1:10M:autoextend
  3. Next check the ibdata1 file exist under C:/xampp/mysql/data/
  4. If file does not exist copy the ibdata1 file from location C:\xampp\mysql\backup\ibdata1

hope it helps to someone.

4 Comments

Copying ibdata1 solved the issue for me, but now I get other errors in phpmyadmin. "Table 'phpmyadmin.pma__tracking' doesn't exist in engine".
This crashed my phpmyadmin using xampp. when i start mysql it's not going start
file exist in my case but error also exist in phpmyadmin and php site
I often see this problem. Copy backup folder and rename as data and after replace the old ibdata1 100% fixed my mysql problem
17

If you have copied & Pasted files from an old backup folder to new then its simple. Just copy the old ibdata1 into your new one. You can find it from \xampp\mysql\data And restart your mysql.

Comments

13

You could:

  1. Rename data folder to data-old
  2. Create new folder and set name to data
  3. Copy backup folder in data folder
  4. Copy ibdata1 in data-old to data folder
  5. Restart MySQL and Apache

After solving the problems, get output power from the database

1 Comment

copying ibdata1 from old folder bring the problem back. if i delete this file then run mysql it is created automaticall and problem is solved.
10

I have faced same issue but copying the xampp\mysql\data\ibdata1 was not solved my problem, because I install new version of xampp, if you upgrading your xampp first make backup from all htdocs and mysql folder, in my case I just backup the all xampp to the new folder like old-xampp then install new xampp and then you need do the following steps before starting your new xampp servers:

  1. Backup the phpmyadmin folder and ibdata1 from your new installation form this location xampp\mysql\data.
  2. Then Go to your old xampp folder old-xampp\mysql\data and copy the ibdata1 file and phpmyadmin from old location.
  3. Then open your new xampp folder xampp\mysql\data and past them there.
  4. Start the xampp servers.

Comments

8
  1. stop mysql
  2. copy xampp\mysql\data\ib* from old server to new server
  3. start mysql

Comments

2

I had previously moved my mysql directory and forgot to change ALL references to the old location in \mysql\bin\my.ini.

change these three lines:

datadir = "/programs/xampp/mysql/data"
innodb_data_home_dir = "/programs/xampp/mysql/data"
innodb_log_group_home_dir = "/programs/xampp/mysql/data"

Change "/programs/xampp/mysql/data" to new location this one was commented but I changed it anyways

#innodb_log_arch_dir = "/programs/xampp/mysql/data"

2 Comments

Also check @Jay Momaya's answer, happenned to me again and that solved it too
This is the perfect solution
2

ok step one you can copy from your old xampp xampp\mysql\data\ibdata1 and step two paste to your xampp new xampp\mysql\data\ibdata1 , and than open your xampp controller and stop mysql and start again.

i tried this and is work for me

Comments

2

Just copy all file which start from ib from old mysql/old-data folder and paste all of these on mysql/data folder

Comments

1

100% working solution

  1. Stop MySQL and Apache and quit Xampp.
  2. Make a backup of the "data" folder.

C:\xampp\mysql\data

  1. Copy all the files from this folder

C:\xampp\mysql\backup 4. Paste and replace to

C:\xampp\mysql\data

Comments

1

Instructions for Ubuntu users:

  1. Copy a database (e.g. from the external disk backup).

    sudo cp -r /media/some_user/mysql/some_database/ /opt/lampp/var/mysql/

NOTE: from this moment on, the database already appears in PHPMyAdmin, but if you click on it, the tables still do not appear

  1. Change the owner to mysql (because when copying the owner it was changed to root)

    sudo chown -R mysql:mysql some_database/

NOTE: from this moment the name of the tables appears but you can't see their structure or data - it shows the error "#1932 - Table 'some_database.some_table' doesn't exist in engine"

  1. Copy the ibdata1 file and also change the owner.

    sudo mv ibdata1 ibdata1_old

    sudo cp /media/some_user/mysql/ibdata1 /opt/lampp/var/mysql/

    sudo chown -R mysql:mysql ibdata1

  2. Restart XAMPP

    sudo /opt/lampp/lampp restart

1 Comment

Legend, Thank you man, saved my day!! i copied the old ibdata1 to mysql in the new installation folder and made it owner and it worked.
0
  • Copy the content of backups folder into data folder. This worked for me.
  • After this you have to reconfigure innodb files of your existent databases

5 Comments

Welcome to Stackoverflow. Would you mind extending your answer little bit more, for fellow programmers, to understand how it helped to solve the problem.
Can you explain your second point? Because first point worked for me and now I lost all the data. I can see the list of tables but when I click on any, says table does not exists in the engine.
@VipulHadiya did you find any solution? I am currently stuck with the same problem as yours.
@RajuAhmed No, fortunately, I had backup of every single database so I have deleted them all and imported all SQL one by one.
@VipulHadiya Yes - this is, also, the best solution I have found also but very time consuming. Having gone through this about 3 times in the past few years. I'm looking for an explanation of how the tables get deleted in the first place and whether there are maintenance steps I can take to prevent that.
0

I had the same issue. I had a backup of my C:\xampp\mysql\data folder. But integrating it with the newly installed xampp had issues. So I located the C:\xampp\mysql\bin\my.ini file and directed innodb_data_home_dir = "C:/xampp/mysql/data" to my backed-up data folder and it worked flawlessly.

Comments

0

None of the above solution works for me. After pasting your old mysql/data directory to your new xampp, Check if ibdata1 has all the permissions required by the current user otherwise try to grant the permissions. Then "Empty Session Data" in your phpmyadmin, solved my problem.

Comments

0

If you have tried all the above answers and yet failed, first try to fix your db by running this command,

mysqlcheck --repair my_db_name -u root -p

And then if issue fixed,

If not fixed and you have a backup of the table with you and not able to import it to the PHPMyAdmin, do the following.

1. Go to xampp\mysql\data\database_folder

2. Delete the files (with extension .frm and .ibd) starting with your table name. Eg: my_table.frm, my_table.ibd

3. Import your table

It worked for me.

Comments

0

Try these steps

  1. stop mysql and apache server
  2. copy backup folder
  3. copy database folders from data folder to backup copy folder
  4. delete ibdata1 from backup copy folder
  5. copy ibdata1 from data folder to backup copy folder
  6. delete data folder
  7. rename backup copy folder to data folder
  8. restart the xampp server

Comments

0

If you have tried every possible solution above and still are not able to solve, you may be able to try this:

only if you have taken a backup previously

For this, consider:
  • database name is dbnm
  • the table that is throwing the error is tbnm
  • Go to the backup/dbnm/ folder.
  • Copy the tbnm.ibd and tbnm.frm files.
  • Go to mysql/bin/data/dbnm/
  • Paste the copied files, and replace the original. See if it works!!

Comments

0

copy from your old xampp xampp\mysql\data\ibdata1 and
copy theNameOfdatabase from xampp\mysql\data\theNameOfdatabase then Then paste to your xampp new xampp\mysql\data\ibdata1, and xampp\mysql\data\theNameOfdatabase

and than open your xampp controller and stop mysql and start again.

basically you are replacing the ibdata1 and copying your database file from your old xammp

Comments

-1

I found the following answer at https://stackoverflow.com/a/66804621 helpful

If you are just moving your DB from one folder to another folder, but your InnoDB tables no longer work, because they can't be found and the error message "Table does not exist in the engine" is displayed, then this SQL statement can be as quick as helpful:

ALTER TABLE __yourtable_name__ IMPORT TABLESPACE ;

In pratice, the .IDB file is actually detached from .FRM file and bound again by this statement, so that table contents turn into readable.

It worked in my case. Hope yours too.

Comments

-2

For me I removed whole data folder ( and took a backup ) from xampp\mysql\ and pasted data folder of previous one here which solved my problem...

2 Comments

Your solution delete my entire database table
Please before you do this, backup the content of the data folder somewhere. Mysql creates folders that keeps files needed by your databases to work.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.