MySQL wont start - Database crashed and now I get Error 1067 - mysql

We have a MySQL database and last night there was a power outage which caused the machine it runs under to crash.
Now with the machine restarted, I am trying to run the MySQL service and I get the error:
"Error 1067: The process terminated unexpectedly"
Extract from the log:
2015-12-14 08:56:17 1248 [Note] Plugin 'FEDERATED' is disabled.
2015-12-14 08:56:17 1248 [Warning] option 'innodb-autoextend-increment': unsigned value 67108864 adjusted to 1000
2015-12-14 08:56:17 d64 InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2015-12-14 08:56:17 1248 [Note] InnoDB: The InnoDB memory heap is disabled
2015-12-14 08:56:17 1248 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2015-12-14 08:56:17 1248 [Note] InnoDB: Compressed tables use zlib 1.2.3
2015-12-14 08:56:17 1248 [Note] InnoDB: Not using CPU crc32 instructions
2015-12-14 08:56:17 1248 [Note] InnoDB: Initializing buffer pool, size = 38.0M
2015-12-14 08:56:17 1248 [Note] InnoDB: Completed initialization of buffer pool
2015-12-14 08:56:17 1248 [Note] InnoDB: Highest supported file format is Barracuda.
2015-12-14 08:56:17 1248 [Note] InnoDB: The log sequence numbers 33664440039 and 33664440039 in ibdata files do not match the log sequence number 35948349561 in the ib_logfiles!
2015-12-14 08:56:17 1248 [Note] InnoDB: Database was not shutdown normally!
2015-12-14 08:56:17 1248 [Note] InnoDB: Starting crash recovery.
2015-12-14 08:56:17 1248 [Note] InnoDB: Reading tablespace information from the .ibd files...
2015-12-14 08:56:24 1248 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace teamcity/action_history which uses space ID: 1 at filepath: .\teamcity\action_history.ibd
InnoDB: Error: could not open single-table tablespace file .\teamcity\action_history.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
Anyone have a solution to this?

The solution, as the message indicates, is likely to be performing innodb_force_recovery > 0.
To do this, just edit my.cnf, search the file for innodb_force_recovery, it'll look like this:
#innodb_force_recovery = 0
Edit it thusly:
innodb_force_recovery = 2
Then restart the MySQL service. After stopping and restarting it, go back and replace the # in the my.cnf file, then restart the service again. Hopefully, you are able to access your tables. If not, try repeating the process, only set the value to 3 instead. Do not go higher than 3 without further researching innodb_force_recovery.
Best of luck, hope this helps.

Related

Mysql failed to start due to errors from innodb

I am trying to run MySql on my Virtual Machine. However, I encountered the following error and thus MySql cannot start up. I am new to MySql. Your help is really appreciated! Here is the message from the error log:
[Note] Plugin 'FEDERATED' is disabled.
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
[Note] InnoDB: Using atomics to ref count buffer pool pages
[Note] InnoDB: The InnoDB memory heap is disabled
[Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
[Note] InnoDB: Memory barrier is not used
[Note] InnoDB: Compressed tables use zlib 1.2.3
[Note] InnoDB: Using Linux native AIO
[Note] InnoDB: Using CPU crc32 instructions
[Note] InnoDB: Initializing buffer pool, size = 128.0M
[Note] InnoDB: Completed initialization of buffer pool
[Note] InnoDB: Restoring page 0 of tablespace 0
[Warning] InnoDB: Doublewrite does not have page_no=0 of space: 0
[ERROR] InnoDB: space header page consists of zero bytes in data file ./ibdata1
[ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Unknown/unsupported storage engine: InnoDB
[ERROR] Aborting
/opt/mysql/mysql/sbin/mysqld: Table 'mysql.plugin' doesn't exist
[ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
IF you read in carefully, first line enlightens the problem and the second line advises solution for it.
run mysql_upgrade to fix it.
Seems, you didn't set path of your ibdata1 or you removed ibdata1 file. Please check my.cnf and set below parameter in my.cnf.
innodb_data_home_dir (path of innodb)
innodb_data_file_path (for example: ibdata1:10M:autoextend)
Note: If it's new setup then also enable innodb_file_per_table

mysql large tables (>4Gb) corrupt after local server restart

I hope someone can help me with this problem I'm having (I'm a newbie to Mysql and Stackoverflow, so it's probably something silly I'm missing)...
Whenever I build a large table in MySQL and then restart xampp's local MySQL server, the table then becomes unreadable under code runs that consider the 'whole' table - e.g. I can't drop it, run mySQLCheck on it or run any aggregation functions like sum / count.
This only happens after a server restart. It is fine when I build the table and then, without restarting, I run the 'whole table' codes on it I mentioned above.
Also, even after a server restart I can still do things like see the indexes in place, or sample the first x rows using Limit.
The error thrown is 'mysqld.exe has stopped working' - 'a problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available'
I stop and restart my server using the xampp start / stop control panel buttons
This only seems to happen when the table is more than 4gb. I'm using innodb
Thank you in advance!
Paul
===============================
An example of the error log result is below. This table (wikivisitstable10) was created by adding an index to the prior table. There are no crash issues with the prior table, just this one - and any similar tables >4gb:
`2016-08-25 0:22:57 6804 [Warning] option
'innodb-max-dirty-pages-pct': value 0 adjusted to 0.001
2016-08-25 0:22:57 6804 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2016-08-25 0:22:57 6804 [Note] InnoDB: The InnoDB memory heap is disabled
2016-08-25 0:22:57 6804 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions 2016-08-25 0:22:57 6804
[Note] InnoDB: Memory barrier is not used 2016-08-25 0:22:57 6804
[Note] InnoDB: Compressed tables use zlib 1.2.3
2016-08-25 0:22:57 6804 [Note] InnoDB: Using generic crc32 instructions
2016-08-25 0:22:57 6804 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-08-25 0:22:57 6804 [Note] InnoDB: Completed initialization of
buffer pool
2016-08-25 0:22:57 6804 [Note] InnoDB: Highest supported
file format is Barracuda.
2016-08-25 0:22:57 6804 [Note] InnoDB: The log sequence numbers 400931068139 and 400931068139 in ibdata files do not match the log sequence number 400931068159 in the ib_logfiles!
2016-08-25 0:22:57 6804 [Note] InnoDB: Database was not shutdown
normally!
2016-08-25 0:22:57 6804 [Note] InnoDB: Starting crash
recovery.
2016-08-25 0:22:57 6804 [Note] InnoDB: Reading tablespace
information from the .ibd files...
2016-08-25 0:22:58 6804 [Note] InnoDB: Restoring possible half-written data pages
2016-08-25 0:22:58 6804 [Note] InnoDB: from the doublewrite buffer...
2016-08-25 00:22:59 1a94 InnoDB: Error: table 'revil2/page'
InnoDB: in InnoDB data dictionary has tablespace id 180, InnoDB: but a tablespace with that id does not exist. There is InnoDB: a tablespace of name revil2/page and id 181, though. Have InnoDB: you deleted or moved .ibd files?
InnoDB: Please refer to InnoDB: DATADICT LINK (REMOVED)
InnoDB: for how to resolve the issue.
2016-08-25 0:22:59 6804 [ERROR] InnoDB: Table revil2/wikipages7 in the InnoDB data dictionary has tablespace id 175, 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.
InnoDB: Please refer to InnoDB: DATA DICT LINK (REMOVED)
InnoDB: for how to resolve the issue.
2016-08-25 0:22:59 6804 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-25 0:22:59 6804 [Note] InnoDB: Waiting for purge to start
2016-08-25 0:22:59 6804 [Note] InnoDB: Percona XtraDB (PERCONA
WEBSITE (REMOVED)) 5.6.28-76.1 started; log sequence number
400931068159
2016-08-25 0:22:59 5820 [Note] InnoDB: Dumping buffer pool(s) not yet started
2016-08-25 00:22:59 16bc InnoDB: Loading buffer pool(s) from .\\ib_buffer_pool
2016-08-25 0:22:59 6804 [Note] Plugin 'FEEDBACK' is disabled.
2016-08-25 0:22:59 6804 [Note] Server socket created on IP: '::'.
2016-08-25 00:22:59 16bc InnoDB: Buffer pool(s) load completed at 160825 0:22:59
2016-08-25 0:23:00 6804 [Note] c:\xampp\mysql\bin\mysqld.exe: ready for connections. Version: '10.1.13-MariaDB' socket: '' port: 3306 mariadb.org binary distribution
InnoDB: Error: trying to access page number 1794 in space 299, InnoDB: space name revil2/wikivisitstable10, InnoDB: which is outside the tablespace bounds.
InnoDB: Byte offset 0, len 16384, i/o type 10.
InnoDB: If you get this error at mysqld startup, please check that InnoDB: your my.cnf matches the ibdata files that you have in the InnoDB: MySQL server.
2016-08-25 00:23:46 1388 InnoDB: Assertion failure in thread 5000 in file fil0fil.cc line 5866
InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed
bug report to HTTP BUGS. MYSQL. COM InnoDB: If you get repeated
assertion failures or crashes, even InnoDB: immediately after the
mysqld startup, there may be InnoDB: corruption in the InnoDB
tablespace.
Please refer to InnoDB: FORCING INNODB RECOVERY LINK (REMOVED)
InnoDB: about forcing recovery. 160825 0:23:46
[ERROR] mysqld got exception 0x80000003 ; This could be because you hit a
bug. It is also possible that this binary or one of the libraries it
was linked against is corrupt, improperly built, or misconfigured.
This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, something
is definitely wrong and this may fail.
Server version: 10.1.13-MariaDB
key_buffer_size=268435456
read_buffer_size=268435456
max_used_connections=1
max_threads=1001
thread_count=1
It is possible that mysqld could use up to key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 788380 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x0x1c172e20 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...
mysqld.exe!my_parameter_handler() mysqld.exe!my_mb_ctype_mb()
mysqld.exe!?get_ctx#MDL_ticket##QBEPAVMDL_context##XZ()
mysqld.exe!?get_ctx#MDL_ticket##QBEPAVMDL_context##XZ()
mysqld.exe!?functype#Item_func_dyncol_create##UBE?AW4Functype#Item_func##XZ()
mysqld.exe!?get_ctx#MDL_ticket##QBEPAVMDL_context##XZ()
mysqld.exe!?get_ctx#MDL_ticket##QBEPAVMDL_context##XZ()
mysqld.exe!?get_trg_event_map#Update_rows_log_event##UAEEXZ()
mysqld.exe!?ha_check#handler##QAEHPAVTHD##PAUst_ha_check_opt###Z()
mysqld.exe!??_9handler##$BBAE#AE()
mysqld.exe!?execute#Sql_cmd_check_table##UAE_NPAVTHD###Z()
mysqld.exe!?mysql_execute_command##YAHPAVTHD###Z()
mysqld.exe!?mysql_parse##YAXPAVTHD##PADIPAVParser_state###Z()
mysqld.exe!?dispatch_command##YA_NW4enum_server_command##PAVTHD##PADI#Z()
mysqld.exe!?do_command##YA_NPAVTHD###Z()
mysqld.exe!?threadpool_process_request##YAHPAVTHD###Z()
mysqld.exe!?tp_end##YAXXZ() KERNEL32.DLL!SetUserGeoID()
ntdll.dll!TpSimpleTryPost() ntdll.dll!EtwNotificationRegister()
KERNEL32.DLL!BaseThreadInitThunk()
ntdll.dll!RtlUnicodeStringToInteger()
ntdll.dll!RtlUnicodeStringToInteger()
Trying to get some variables. Some pointers may be invalid and cause
the dump to abort. Query (0x1c232750): CHECK TABLE
`wikivisitstable10` Connection ID (thread ID): 2 Status: NOT_KILLED`
Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on

Error: could not open single-table tablespace file .\scrapers\records.ibd

I have AMPPS installed on my Windows 10.
I was unable to start MySQL. I have searched through this error and tried different things to recover my data.
This was the error log:
2016-02-03 10:19:54 6448 [Warning] You need to use --log-bin to make --binlog-format work.
2016-02-03 10:19:54 6448 [Note] Plugin 'FEDERATED' is disabled.
2016-02-03 10:19:54 6448 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-02-03 10:19:54 6448 [Note] InnoDB: The InnoDB memory heap is disabled
2016-02-03 10:19:54 6448 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2016-02-03 10:19:54 6448 [Note] InnoDB: Memory barrier is not used
2016-02-03 10:19:54 6448 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-02-03 10:19:54 6448 [Note] InnoDB: Not using CPU crc32 instructions
2016-02-03 10:19:54 6448 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2016-02-03 10:19:54 6448 [Note] InnoDB: Completed initialization of buffer pool
2016-02-03 10:19:54 6448 [Note] InnoDB: Highest supported file format is Barracuda.
2016-02-03 10:19:54 6448 [Note] InnoDB: The log sequence numbers 0 and 0 in ibdata files do not match the log sequence number 132125643 in the ib_logfiles!
2016-02-03 10:19:54 6448 [Note] InnoDB: Database was not shutdown normally!
2016-02-03 10:19:54 6448 [Note] InnoDB: Starting crash recovery.
2016-02-03 10:19:54 6448 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-02-03 10:19:54 6448 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace mysql/innodb_table_stats uses space ID: 1 at filepath: .\mysql\innodb_table_stats.ibd. Cannot open tablespace scrapers/openpasts_records which uses space ID: 1 at filepath: .\scrapers\openpasts_records.ibd
InnoDB: Error: could not open single-table tablespace file .\scrapers\openpasts_records.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
I have tried setting innodb_force_recovery = 1 in my.cnf
Also I have tried removing ibdata1 file as well.
After removing ibdata1, MySQL started perfectly.
and my table shows in PHPmyADMIN, but when I click on it it says table does not exists even it exists
In my D:\Ampps\mysql\data\scrapers directory, I can see records.ibd file and records.frm file as well. That means table physically exists but is corrupted.
Does someone know how do I recover that table?
set value of
innodb_force_recovery = 1
or 2 or 3 or 4
in my.ini file under [mysql]
try this hopefully it will solve your problem.

restore mysql database from an old mysql folder

i want to restore one database from my old mysql folder,
i copied mysql/data folder from old installation into my current mysql folder, yet its not starting up any more.
when i check the error_log file i see
2014-05-04 11:01:24 5344 [Note] Plugin 'FEDERATED' is disabled.
2014-05-04 11:01:24 1d5c InnoDB: Warning: Using innodb_additional_mem_pool_size is DEPRECATED. This option may be removed in future releases, together with the option innodb_use_sys_malloc and with the InnoDB's internal memory allocator.
2014-05-04 11:01:24 5344 [Note] InnoDB: The InnoDB memory heap is disabled
2014-05-04 11:01:24 5344 [Note] InnoDB: Mutexes and rw_locks use Windows interlocked functions
2014-05-04 11:01:24 5344 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-05-04 11:01:24 5344 [Note] InnoDB: Not using CPU crc32 instructions
2014-05-04 11:01:24 5344 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2014-05-04 11:01:24 5344 [Note] InnoDB: Completed initialization of buffer pool
2014-05-04 11:01:24 5344 [Note] InnoDB: Highest supported file format is Barracuda.
2014-05-04 11:01:24 5344 [Note] InnoDB: The log sequence numbers 1689664 and 1689664 in ibdata files do not match the log sequence number 3461183 in the ib_logfiles!
2014-05-04 11:01:24 5344 [Note] InnoDB: Database was not shutdown normally!
2014-05-04 11:01:24 5344 [Note] InnoDB: Starting crash recovery.
2014-05-04 11:01:24 5344 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-05-04 11:01:24 5344 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace database/settings uses space ID: 146 at filepath: .\database\settings.ibd. Cannot open tablespace elegant/encounter_dr which uses space ID: 146 at filepath: .\elegant\encounter_dr.ibd
InnoDB: Error: could not open single-table tablespace file .\elegant\encounter_dr.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
i'm not sure what exactly is the problem, i copied the folder as is.. may be its a different mysql version (2years old backup) but i'm sure everthing is there !.
is there anyother way to restore database from data folder ?
I saw in log file that elegant db is causing the problem, since i dont even need it i deleted the hole folder. now mysql starts but it show only tables, and when ever i try to use this table it say Table doesnot exists
i check log now there is a new errors
2014-05-04 11:03:41 7828 [Warning] InnoDB: Cannot open table z125/inventory_items from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.
2014-05-04 11:03:41 7828 [Warning] InnoDB: Cannot open table z125/inventory_transactions from the internal data dictionary of InnoDB though the .frm file for the table exists. See http://dev.mysql.com/doc/refman/5.6/en/innodb-troubleshooting.html for how you can resolve the problem.

MySQL doesn't starts on AMPPS OS X

I have I problem with starting mysql using AMPPS. I'm Using OS X Maverics and last version of Ammps. After little system crash and restart I can`t start mysql.
mysql.err
2014-01-22 18:12:41 398 [Note] Plugin 'FEDERATED' is disabled.
2014-01-22 18:12:41 398 [Note] InnoDB: The InnoDB memory heap is disabled
2014-01-22 18:12:41 398 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2014-01-22 18:12:41 398 [Note] InnoDB: Compressed tables use zlib 1.2.3
2014-01-22 18:12:41 398 [Note] InnoDB: Not using CPU crc32 instructions
2014-01-22 18:12:41 398 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2014-01-22 18:12:41 398 [Note] InnoDB: Completed initialization of buffer pool
2014-01-22 18:12:41 398 [Note] InnoDB: Highest supported file format is Barracuda.
2014-01-22 18:12:41 398 [Note] InnoDB: The log sequence numbers 1252002624 and 1252002624 in ibdata files do not match the log sequence number 1252003161 in the ib_logfiles!
2014-01-22 18:12:41 398 [Note] InnoDB: Database was not shutdown normally!
2014-01-22 18:12:41 398 [Note] InnoDB: Starting crash recovery.
2014-01-22 18:12:41 398 [Note] InnoDB: Reading tablespace information from the .ibd files...
2014-01-22 18:12:41 398 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace analytics/backlinks uses space ID: 1 at filepath: ./analytics/backlinks.ibd. Cannot open tablespace mysql/innodb_table_stats which uses space ID: 1 at filepath: ./mysql/innodb_table_stats.ibd
2014-01-22 18:12:41 a08901a8 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./mysql/innodb_table_stats.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
Help me please. I have very important files in DB.
Solve!
Open AMPPS Application -> MySQL Tab -> Configuration.
In [mysqld] section, add the following line:
innodb_force_recovery = 1
Save the file and try starting MySQL
Remove that line which you just added and Save.
So I was facing a similar issue and what I tried was following:-
find / -name mysql
From the output of above command remove all the search results.Then do following:-
brew uninstall mysql
brew clean
Then reboot your machine once and then install once again using following:-
brew install mysql
P.S: I was getting this error error so I could not take backup of my db but I had not so much important data in DB so I removed it anyways