Retrieve data only from Mysql Innodb .ibd file on Mac OS - mysql

I am a newbie to Mysql/Mac OS. Yesterday I turned my laptop (Yosemite 10.10.5) on and found that mysql workbench 6.3 was complaining when retrieving data from one of my tables:
Error Code: 1932. Table 'mydb.mytable' doesn't exist in engine
I cant think why this would suddenly start happening. The ibd file is 2.4GB but I guess that makes no difference.
The table is stored in INNODB format.
All I need to do is get the data, even if its in a text file or something, I dont care about relinking the data back into MySQL. At this stage all I care about is the data.
I've tried various things:
innodb_force_recovery (values from 0-6) (same error occurred)
PERCONA innodb recovery tool (i couldnt get it to compile)
deleting and recreating tablespaces (same error occurred)
http://www.chriscalender.com/tag/innodb-error-tablespace-id-in-file/ - but this does not give me the error he says it should, hence he thinks I should be able to dump my table (which I cant) as the same error occurs.
I'm at my wits end. Is there any way to get my data back? Any advice much appreciated.

Related

MySQL 8.0 Table corrupted

I was running an optimize on a 70GB+ data table (after adding a bit column), and the database just crashed.
When browsing the data folder, I have a [table].ibd file and a #sql-*.ibd orphan file.
The only way I could restart mysql daemon was to start it with innodb_recovery_mode = 6.
But when reading the table, the columns have values that do not make any since.
One of the columns that is of type BIGINT just repeats the same number for rows on end...
I tried do DISCARD TABLESPACE and the IMPORT it again - it crashes the service while doing it.
InnoDB warns about corrupted table and also corrupted indexes.
I'm looking for help to try and recover the data, since it is very important.
Is it possible to read the .ibd file and recover the data?
I also used "undrop-for-innodb" to try to recover the data, but the values in the rows make no sense.
Thank you in advance.

Cannot browse phpMyAdmin table: Error #1038 - Out of sort memory, consider increasing server sort buffer size

Trying to view a very old MyISAM table in phpMyAdmin, it fails with SQL error:
#1038 - Out of sort memory, consider increasing server sort buffer size
I presume phpMyAdmin is running a SELECT * FROM my_table here.
However, if I copy the table (structure and data), the copied table can be viewed no problem. I'm looking for some guidance as to what might be causing the error on the original table and why making a straight copy sorts the issue out.
Try to convert myISAM db to InnoDB so that you can get away from that error.
Hope this link will help you.

Windows Server mysql system tables converted to innodb won't start

We recently ran a script against a mysql to convert all tables to use innodb. Unfortunately, this also included the system tables. The server will no longer start.
I didn't figure it would probably matter in this case, but also tried the
innodb_force_recovery in the config file and restarting. Same error.
Is there any way to get back to myisam from this dumb conversion on the system tables?
Dump we're receiving
Thread pointer: 0x92eb40
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
000000014009A9A1 mysqld.exe!ha_resolve_by_name()[handler.cc:135]
0000000140119F6F mysqld.exe!open_binary_frm()[table.cc:897]
000000014011C12B mysqld.exe!open_table_def()[table.cc:644]
0000000140078204 mysqld.exe!get_table_share()[sql_base.cc:379]
000000014007829D mysqld.exe!get_table_share_with_create()[sql_base.cc:478]
000000014007A9B3 mysqld.exe!open_unireg_entry()[sql_base.cc:3874]
000000014007E0C1 mysqld.exe!open_table()[sql_base.cc:2931]
000000014007ED61 mysqld.exe!open_tables()[sql_base.cc:4630]
000000014007F258 mysqld.exe!open_and_lock_tables_derived()[sql_base.cc:5041]
000000014003643C mysqld.exe!plugin_load()[sql_plugin.cc:1417]
000000014003772A mysqld.exe!plugin_init()[sql_plugin.cc:1252]
000000014001DB5E mysqld.exe!init_server_components()[mysqld.cc:4021]
000000014001E315 mysqld.exe!win_main()[mysqld.cc:4490]
000000014001E6AF mysqld.exe!mysql_service()[mysqld.cc:4666]
00000001402EBAB7 mysqld.exe!_callthreadstart()[thread.c:295]
00000001402EBB85 mysqld.exe!_threadstart()[thread.c:275]
0000000076C7A4BD kernel32.dll!BaseThreadInitThunk()
0000000077076461 ntdll.dll!RtlUserThreadStart()
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0000000000000000): =
Connection ID (thread ID): 0
Status: NOT_KILLED
Yeah, that is bad news. The mysql tables should not be converted from MyISAM; MySQL cannot work if they are.
Plan A: If you have any sort of dump, reload at least the database mysql from that dump. Then we can discuss how to get your tables loaded or whatever.
Plan B: Install a new copy of MySQL; it will have 'correct' in mysql (but won't have your GRANTs, etc.) Then we can discuss how (and whether) you can get your tables reloaded/rebuilt.
What dump(s) do you have? Recent? Old? In MyISAM? In InnoDB? What was the value of innodb_file_per_table? What version are you coming from / going to? (There, I am thinking about "transportable tablespaces".)
Won't help at the moment, but you should review the other gotchas in the conversion: http://mysql.rjweb.org/doc.php/myisam2innodb .

MySql stops writing, but keeps reading

I have a magento store running on Debian, with LAMP, the server is a VPN with 1GB RAM, 1 Core Processor.
MySQL randomly but often stops writing new data to tables, magento doesn't show any error, says that it successfully saved the data. It can read the tables without problem, the website keeps running okay, it just doesn't save any new data.
If I restart MySQL it starts saving new data again, then randomly (I think, couldn't relate it to any action) stops writing some time later, it can be days or hours.
I've turned on query log, but not sure what to look for on it,
I found this common error after mysql stops writing: INSERT INTO index_process_event (process_id,event_id,status) VALUES ('7', '10453', 'error') ON DUPLICATE KEY UPDATE status = VALUES(status);
I've tried to reindex the whole process table as suggested by Henry, but no success.
After reindexing the event_id changed.
I don't believe the problem is low RAM, the website only get around 200 sessions/day, hardly more than 2 users online at the same time.
Thanks, I appreciate any help.
try to see if there is any space left on your storage.
also try to see in system log in addition of mysql log.
grep / find for any line that have "error" string.

Automaticly repair db table after crash, or switch to InnoDB

Sometimes tables in the mySQL database crash after a server restart or after a lost connection to the database.
This have happen several times for the last 3-4 weeks.
This is how the error message looks like:
145 - Table './xxx/sessions' is marked as crashed and should be
repaired select value from sessions where sesskey =
'60fa1fab3a3d285cfb7bc1c93bb85f64' and expiry > '1395226673'
[TEP STOP]
So far it’s have been the tables "sessions" and "whos_online" that have crashed. If I repair the tables in phpmyadmin it will work fine again
After the last crash I changed "sessions" from MyISAM to InnoDB. The table "whos_online" still use MyISAM.
I use osCommerce 2.2 rc2a and I'm looking for any thoughts and suggestions in this matter.
One solution might be to change both these tables to InnoDB, since it supposed to be self-healing. Is that a good or bad idea?
Another one would be to have them in MyISAM and do something like this with the php-file that echo the error message:
if $error contain "is marked as crashed and should be repaired"
run a table repair script
Would that be a good or bad idea?
Here’s my server specs
Database: MySQL 5.5.36-cll
PHP Version: 5.3.15
At first you should address the issue that tables become corrupted in the first place. InnoDB tries to repair broken files, but it cannot do magic. Repeated unsafe shutdowns or other accidents may seriously corrupt your database!
If you only have a small website, all variants are good. MyISAM is a little faster (sometimes), while InnoDB provides some extended features. If the server is strong enough, you will likely encounter no issues. I would stick with InnoDB in most cases as it accounts for consistent data and throws errors if files are broken, unlike MYISAM tables which are used and then sometimes throw errors in production...
But if something severely breaks, it requires more effort to get MySQL with InnoDB back up running if it does not automatically. There exist different InnoDB recovery modes which are only available from the shell of your server and require modifying the config file, starting the server by hand, reading its output and maybe doing some other actions. If you do not have any clue of these issues, you might want to stick with MyISAM instead. The server always starts, and if the table is utterly broken, you might need to import a backup. But this is more easily than editing config files and reading database outputs etc.