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

Xampp error after moving xampp folder:
Apache is running fine:
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

I have faced same issue and sorted using below step.
Go to MySQL config file (my file at C:\xampp\mysql\bin\my.ini)
Check for the line innodb_data_file_path = ibdata1:10M:autoextend
Next check the ibdata1 file exist under C:/xampp/mysql/data/
If file does not exist copy the ibdata1 file from location C:\xampp\mysql\backup\ibdata1
hope it helps to someone.

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

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.

Don't copy ibdata1 file
This occurred to me when I take all files from the backups folder. There is a file you should not copy with other folders and files, called ibdata1.

stop mysql
copy xampp\mysql\data\ib* from old server to new server
start mysql

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:
Backup the phpmyadmin folder and ibdata1 from your new installation form this location xampp\mysql\data.
Then Go to your old xampp folder old-xampp\mysql\data and copy the ibdata1 file and phpmyadmin from old location.
Then open your new xampp folder xampp\mysql\data and past them there.
Start the xampp servers.

You could:
Rename data folder to data-old
Create new folder and set name to data
Copy backup folder in data folder
Copy ibdata1 in data-old to data folder
Restart MySQL and Apache
After solving the problems, get output power from the database

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"

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

100% working solution
Stop MySQL and Apache and quit Xampp.
Make a backup of the "data" folder.
C:\xampp\mysql\data
Copy all the files from this folder
C:\xampp\mysql\backup
4. Paste and replace to
C:\xampp\mysql\data

Instructions for Ubuntu users:
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
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"
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
Restart XAMPP
sudo /opt/lampp/lampp restart

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

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.

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.

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.

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.

I also had same issue on my mac. I was running 5.3.0 version. I removed that version and installed 7.2.1 version. After this it is working in my case.

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

Related

Unable to Start MySql (8.0.15) on OS-X High Sierra (10.13.6) PID File

Starting on PHP/MySQL Development and as the title states, downloaded MySQL 8.0.15 DMG. Installed. However, when I attempt to run the terminal command:
"sudo /usr/local/mysql/support-files/mysql.server.start"
I get:
"Starting MysQl .......... "
which finally ends in:
ERROR! The server quit without updating PID file (/usr/local/mysql/data/Macbook.hsd.comcast.net.pid)
So far I have tried:
Tried to remove the "Macbook.hsd.comcast.net.pid" file located in the data directory but all i keep getting a "No Such file or directory"
To look for default "my.cnf" file to mod or to add the default values, HOWEVER I read that: "By default the OS X installation does not use a my.cnf, and My SQL just uses the default values. To set up your own my.cnf, you could just create a file straight in /etc.
An "auto.cnf" exists in the data folder, i'm not sure if MySQL uses that or would respect a "my.cnf" created in the /usr/local/sql/data/ folder.
I'm not sure of the proper location to create a "my.cnf" (see, all I want to do is set the proper value for the "pid-file" such as pid-file = /var/run/mysqld/mysqld.pid and then create the directory and give it the proper permissions. SEE UPDATE AT BOTTOM:
I'm cannot access the "data" folder in MySQL folder (which is alias of): "/usr/local/mysql-8.0.15-macos10.14-x86_64/". It keeps telling me I don't have permission. There is a little red dot
I have set checked the permissions in "/user/local/mysql/" and did a
"sudo chown -RL root:mysql /user/local/mysql"
"sudo chown -RL _mysql:mysql /usr/local/mysql/data"
In the /mysql/ directory now everything reads:
Stumped and not sure where to move on from here.
Is the fact that I can't access the data folder a result because I haven't made one/specified one? Can't seem to find an answer for getting MySQL working with HighSierra/Mojave. I can't believe that it's just dead.
I would appreciate any/all help.
UPDATE/EDIT:
Was able to add my user permissions to the "/user/local/mysql/data" folder and was finally able to access the error file ("Macbook.hsd.comcast.net.err") and a "auto.cnf".
The "auto.cnf" file is empty besides a single line: [auto] server-uuid=e7986494-331d-11e9-9691-bec9b3249da6 (not sure if I need to modify the auto.cnf and add PID entries). See error BELOW which seems to indicate otherwise.
The Error file had repeated Errors (occurred several Times):

Unable to Start mysql after Update from 5.0.12 to 5.7.18

I tried to update MySQL from 5.0.12 to 5.7.18 but unable to start MySQL after upgrade. I performed following steps.
I downloaded Zip Archive file from MySQL Community Server.
I extracted the archive file in Temp Folder.
I renamed the mysql folder to mysql_backup
I created a new mysql folder and pasted all the newly extracted files in that folder
I copied data folder from old mysql_backup folder to newly created mysql folder.
I copied my.ini from old mysql_backup folder to new mysql folder's bin directory.
I tried to start mysql service but it gives error.
I removed following line as per this suggestion but still same error.
innodb_additional_mem_pool_size = 2M
There is nothing in error log of mysql. It seems to be my.ini issue. Please help me out.
At last I have found the answer using Windows Event Viewer. The issue was with the below line in [mysqld] section which I have commented-out/removed from my.ini file and now MySQL have started:
key_buffer = 16M
After commenting this out this line will be:
#key_buffer = 16M
Please do check your Windows Event Viewer for more clues to the errors in XAMPP Control Panel.
In my case, I had to move the my.ini file from /data folder to /bin folder

MySQL Errcode 2 - problems creating database directories

This doesn't seem far too specific, but somehow I cannot find anyone else with this problem (at least on stack and google). People have issues with errcode 2, but every thing I've seen is people having issues with mysql's tmp directory. I've tried changing that, and that's given no luck.
I've also made sure that the owner/group of the mysql "datadir" is mysql.
I'm assuming the cause of this is because I have recently moved the mysql datadir to my /ssd directory.
I have changed the datadir location after copying /var/lib/mysql to /ssd and have restarted mysql.
For /var/lib/mysql, I renamed the mysql folder to mysql-old, as that folder was no longer in use. Just in case, I created a symlink in place of it that points to the /ssd/mysql directory.
For context, I am trying to import an sql file and it seems it cannot create the data or directories themselves. Here is the full error:
ERROR 1 (HY000) at line 33: Can't create/write to file '/var/lib/mysql/changelog/changelog.MYI' (Errcode: 2)
In this instance, I'm trying to import a database named changelog
Even after changing the datadir entirely, it still seems to want to write to /var/lib/mysql - Why is that?
You may try to look into section [mysqld] in my.cnf or mysqld.cnf in /etc/mysql/
It could be either due to too many files being open or tmp directory having no permission for your user.
http://alvinalexander.com/mysql/mysql-cant-create-write-file-error-message
I ran into similar error message when trying to create a new database. The final solution is uninstall mysql and reinstall it again. Everything was fine. There are some corruption in the file which caused the errno 2.

Is it OK to move an old MySQL data folder to a new MySQL install's folder?

I've installed MySQL on my Mac running lion using their DMG installer. This has created 2 folders, mysql-5.5.15-osx10.6-x86_64 and mysql-5.5.9-osx10.6-x86_64 with a symlink from /usr/local/mysql/ leading to the newer one. My databases are still in the old folder, in the data folder.
Is it OK to just delete the new data folder, then move the old data folder into the newly installed folder (/usr/local/mysql-5.5.15-osx10.6-x86_64) using this:
sudo mv /usr/local/mysql-5.5.9-osx10.6-x86_64/data /usr/local/mysql-5.5.15-osx10.6-x86_64/data
Are there any gotchas I need to worry about? Is it smarter to just change this in the configuration file?
You should look at your my.cnf file to see which folder it is pointing to as the datadir. If you delete the folder it's pointing to, it won't know where to find your data. You can change this value to point to where ever you want your data stored.

MySQL tables on external hard drive

I have a large amount of text data I need to import into MySQL. I'm doing this on a MacBook and don't have enough space for it so I want to store it in an external hard drive (I'm not really concerned about speed at this point - this is just for testing).
What's the best way to do it?
Install MySQL on the external hard drive (is this possible on a Mac?)
Install MySQL on the laptop's hard drive and have the tables on the external (how?)
One simple hack is to create an symbolic link replacing your current mysql database file location pointing to the external disk. Google symbolic link.
sample usage would be after you shutdown mysql, change the old mysql db folder name to something else, and create the symbolic link using the ln command like below
ln -s [EXTERNAL DRIVE PATH] [MYSQL DB FOLDER PATH]
Then move all the previous content of the mysql db folder to the new location.
Open /etc/mysql/my.cnf and find the value of the datadir. Alternatively, you can find this out in the mysql monitor with
mysql> select ##datadir;
Stop mysql
sudo systemctl stop mysql
Copy the data from there to your external drive
sudo rsync -av /var/lib/mysql /mnt/myHDD/somedir/mysql
Modify the location of the datadir in my.cnf.
Start mysql again
sudo systemctl start mysql
Verify that everything is still fine and remove the original data dir.
This page contains a more extensive guide but all the additional issues it warns about were not relevant for me on my raspberry PI. I.e. I skipped them and it worked.
For the second option, a tablespace might do the trick:
http://dev.mysql.com/doc/refman/5.1/en/create-tablespace.html
User user658991 answer is halfway there.
After adding the soft link, you will need to add the following line to /etc/apparmor.d/usr.sbin.mysqld beneath the 2 lines to the old mysql folder.
/path/to/mysql/folder/on/the/external/ r
/path/to/mysql/folder/on/the/external/ ** rwk
Without these 2 lines, MySQL fails to start complaining of:
Can't create test file /path/to/mysql/folder/on/the/external/hostname.lower-test
Can't create test file /path/to/mysql/folder/on/the/external/hostname.lower-test
mysqld: Can't change dir to '/path/to/mysql/folder/on/the/external/' (Errcode: 13)
Restart apparmor for the changes to take effect.
sudo invoke-rc.d apparmor restart
With this, MySQL starts normally.