MAMP how do I rescue my MySQL database - mysql

Apologies I am quite new at this, so the easier the better! I need to rescue a wordpress database from a corrupted MAMP installation.
This is the error I am receiving in the MySQL Log when I try and open MAMP:
https://codeshare.io/GqPykx
Thanks for any assistance!!
K

You could start by applying the specified methods to restore to a known state. If you're lucky you have permissions problem you just need to fix on the table storage files, if you're unlucky you should restore from your backup disk.
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 ./olivia/wp_term_taxonomy.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.

Related

MySQL Not starting with MAMP

I know this might seem a duplicate, but I am struggling.
I managed to start and run Apache and MySQL for one session using MAMP. Come to it again, MySQL will not start.
I have tried various answers on Stack. Reinstalling / moving directories / making sure things are update. The one thing I haven't done, is renaming the 'ib_logfile' - because they are not there!
Anyone have any suggestions?
2017-09-23 20:44:46 7fffa5a753c0 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/slave_worker_info.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.
170923 20:44:46 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
So far I got it working - I change the permissions for the Mysql folder in Mamp to read and write and all the containing folders and it seems to work.
go to /Applications/MAMP/tmp/mysql/ and add new file mysql.pid
restart mamp

MySQL Server not starting with MAMP

My MySQL Server wont start anymore on MAMP. The solutions I found online said, that I should first quit MAMP, quit the MYSQL process, and start MAMP again.
But there is no MySQL process running in my situation, so this didn't work. Do you have any idea, what else could be the process?
You can find my error log here:
2017-01-20 21:40:03 7fff79bb0000 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 ./yunityproject_wordpress/wp_comments.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. 170120 21:40:04 mysqld_safe mysqld
from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
Just had this issue. Turns out a mysql.pid file was missing from the mamp\tmp\mysql\ folder. uninstalled, reinstalled and everything works. just make sure you delete the old mamp folder.
[coincidence? my mamp-pro license just expired and then this issue happened]

MAMP Pro mysql can't start

I'm having problem can't find way to fix this. I get this error
2017-01-11 23:58:25 7fffbac563c0 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_index_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.
170111 23:58:26 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
Any suggestion how can I fix this?
Thanks
You can edit MySQL my.cnf solve this problem.
find: file -> edit template -> MYsql(my.cnf)
find: 'innodb_force_recovery' = 1
Hope to help you!

MySQL refusing to start

I recently upgraded XAMPP, and (stupidly, probably) simply copied my old mysql/data folder into the new installation. I'm not sure what version of MySQL I was running before, but it was probably 5.1. The new version is 5.6. Whenever I start MySQL now, I get this error:
2014-11-05 23:31:04 8784 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace db_name/table_name uses space ID: 2 at filepath: .\db_name\table_name.ibd. Cannot open tablespace mysql/innodb_index_stats which uses space ID: 2 at filepath: .\mysql\innodb_index_stats.ibd
InnoDB: Error: could not open single-table tablespace file .\mysql\innodb_index_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.
I know from this question and others that deleting the ibdata1 and ib_logfile0 files temporarily solves this problem, but I need to do it each time I start XAMPP / MySQL. Is there a way to fix this problem permanently?

Akonadi (KDE) crash: repair InnoDB data when MySQL can't start

I run a small MySQL installation as part of my Akonadi (under KDE) installation. At some point recently some of my InnoDB data has become corrupted. I'm not sure, but it may be related to a recent update of some KDE packages. Right now I'm trying to get a set of recovery tools to compile (https://launchpad.net/percona-data-recovery-tool-for-innodb).
Until then, figured I'd try SO for some advice.
Unfortunately, MySQL will not run due to the corruption, most of the help I've found online relies on it to be running. Output of mysqld: http://paste.kde.org/prkw3di6d
In particular, we have
140727 9:00:22 [Note] InnoDB: The log sequence numbers 13418196 and 13418196 in ibdata files do not match the log sequence number 53487166 in the ib_logfiles!
140727 9:00:22 [Note] InnoDB: Database was not shutdown normally!
140727 9:00:22 [Note] InnoDB: Starting crash recovery.
140727 9:00:22 [Note] InnoDB: Reading tablespace information from the .ibd files...
140727 9:00:22 [Note] InnoDB: Restoring possible half-written data pages
140727 9:00:22 [Note] InnoDB: from the doublewrite buffer...
140727 9:00:23 [ERROR] mysqld got signal 11 ;
Fortunately, it seems that only a few of the ibd files were modified recently. Let me know what other information could help with this issue.
You haven't exhausted low-hanging fruits yet.
First, try to start MySQL with innodb_force_recovery=4 (or 5, or 6). InnoDB crashes during crash recovery process, so it's better to skip it.
If it starts take a dump of all databases and re-create InnoDB table spaces.
Optionally you could check if you can repair the database without dump&reload as I described in "Repair Corrupted InnoDB Table with Corruption in Secondary Index Edit" post.
Only if MySQL doesn't start with innodb_force_recovery=6 then you need to fetch records from ibd files.
By the way, I continue development of the recovery toolkit in https://launchpad.net/undrop-for-innodb . I fixed some bugs related to recent MySQL versions and made it easier to use (no need to recompile, no dependencies on unneeded libraries)