MAMP Mysql Error - Failed to open log
Asked Answered
S

3

12

I've been working with a MAMP installation for several weeks now, and when I started it up today it would not start. No mysql process was running so I checked the error log which shows the following when I start the server:

130826 14:19:55 mysqld_safe Starting mysqld daemon with databases from /Applications/MAMP/db/mysql
130826 14:19:55 [Warning] You have forced lower_case_table_names to 0 through a command-line option, even though your file system '/Applications/MAMP/db/mysql/' is case insensitive.  This means that you can corrupt a MyISAM table by accessing it with different cases. You should consider changing lower_case_table_names to 1 or 2
130826 14:19:55 [Warning] One can only use the --user switch if running as root

130826 14:19:55 [Note] Plugin 'FEDERATED' is disabled.
130826 14:19:55 InnoDB: The InnoDB memory heap is disabled
130826 14:19:55 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130826 14:19:55 InnoDB: Compressed tables use zlib 1.2.3
130826 14:19:55 InnoDB: Initializing buffer pool, size = 128.0M
130826 14:19:55 InnoDB: Completed initialization of buffer pool
130826 14:19:55 InnoDB: highest supported file format is Barracuda.
130826 14:19:55  InnoDB: Waiting for the background threads to start
130826 14:19:56 InnoDB: 1.1.8 started; log sequence number 4057202289
/Applications/MAMP/Library/bin/mysqld: File './mysql-bin.000025' not found (Errcode: 2)
130826 14:19:56 [ERROR] Failed to open log (file './mysql-bin.000025', errno 2)
130826 14:19:56 [ERROR] Could not open log file
130826 14:19:56 [ERROR] Can't init tc log
130826 14:19:56 [ERROR] Aborting

130826 14:19:56  InnoDB: Starting shutdown...
130826 14:19:57  InnoDB: Shutdown completed; log sequence number 4057202289
130826 14:19:57 [Note] /Applications/MAMP/Library/bin/mysqld: Shutdown complete

130826 14:19:57 mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended

So it's clear that a certain log file cannot be found, but I don't know why that happened, or how to fix it.

Snail answered 26/8, 2013 at 11:28 Comment(0)
S
25

It seems that one of the binary log files, Applications/MAMP/db/mysql/mysql-bin.000025, got corrupted or deleted (it was no longer there, and I did not manually delete it).

After doing some research and finding this post, I was able to fix this by navigating to /Applications/MAMP/db/mysql and manually editing mysql-bin.index to no longer include the missing log file.

I'm still a little confused what led to this issue originally though, since I shut down my MAMP server normally and never touched the binary log files...

Snail answered 26/8, 2013 at 11:38 Comment(0)
R
5

For MySQL 8.0 the file mysql-bin.index changed to binlog.index. In this case a deletion and restarting MySQL solves the problem.

Repast answered 22/8, 2018 at 22:3 Comment(0)
S
0

For me, from /var/lib/mysql/ running cat mysql-logbin.index showed binary (gibberish).

At first I thought this meant that it was just a binary file, but that file is not supposed to be binary, as far as I know it's supposed to contain something like a single line of text indicating the name of the current logbin file.

I renamed it to mysql-logbin.index.old and tried starting the service and it started successfully, recreating that file.

Spicule answered 5/8, 2022 at 23:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.