Yagya Bashyal
Yagya Bashyal

Reputation: 691

Xampp-mysql - "Table doesn't exist in engine" #1932

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

Upvotes: 68

Views: 450109

Answers (20)

Vishal Pathriya
Vishal Pathriya

Reputation: 67

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

Upvotes: 1

Hasitha
Hasitha

Reputation: 149

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

Upvotes: 0

Vincent Dsouza
Vincent Dsouza

Reputation: 11

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!!

Upvotes: 0

Toki
Toki

Reputation: 294

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

Upvotes: 0

M.Ali El-Sayed
M.Ali El-Sayed

Reputation: 1779

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 these pair of SQL statements can be as quick as helpful:

ALTER TABLE __yourtable_name__ DISCARD TABLESPACE ;

ALTER TABLE __yourtable_name__ IMPORT TABLESPACE ;

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

It worked in my case. Hope yours too.

Upvotes: 0

SandroMarques
SandroMarques

Reputation: 6534

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

Upvotes: 1

Ahsan Najam
Ahsan Najam

Reputation: 363

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

Upvotes: 2

abolfazl maherani
abolfazl maherani

Reputation: 168

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

Upvotes: 13

Jay Momaya
Jay Momaya

Reputation: 2049

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.

Upvotes: 17

Jopsy
Jopsy

Reputation: 173

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.

Upvotes: 0

Taufik Hasan A
Taufik Hasan A

Reputation: 246

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

Upvotes: 2

Muhammad Bilal
Muhammad Bilal

Reputation: 517

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...

Upvotes: -2

Jerry Sam
Jerry Sam

Reputation: 111

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.

Upvotes: 0

Zurupupz
Zurupupz

Reputation: 345

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"

Upvotes: 2

Nazari
Nazari

Reputation: 643

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.

Upvotes: 10

Abu Mutea
Abu Mutea

Reputation: 1

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.

Upvotes: 0

kan
kan

Reputation: 81

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

Upvotes: 8

Nava Bogatee
Nava Bogatee

Reputation: 1765

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

Upvotes: 95

Rohan Patil
Rohan Patil

Reputation: 1963

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.

Upvotes: 64

lsfiege
lsfiege

Reputation: 17

  • 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

Upvotes: 0

Related Questions