This is not explicitly a macOS Big Sur issue, but could be related to when you sync your MAMP’s MySQL mysql57
-folder across multiple Macs (see this previous post on how to achieve this).
Start MAMP MySQL service: pid error
However, I ran into this MAMP issue on Big Sur 11 Beta when trying to launch MAMP’s MySQL service using
/Applications/MAMP/bin/start.sh
/Applications/MAMP/bin/startMysql.sh
Which was unsuccessful and showing the error
mysqld_safe mysqld from pid file /Applications/MAMP/tmp/mysql/mysql.pid ended
Possible fixes to successfully start MAMP MySQL again
In order to fix this mysql.pid error, the following steps can help resolving the issue – start from top to bottom in order to narrow down the one blocking your MAMP MySQL service from starting up.
Quit any running mysqld
services
Open the Terminal.app and check if the list of processes contains one or more entries named “mysqld
“:
lsof -i
If yes, this means you already have a MySQL service running. Use the following command to discard all the running mysqld
processes:
sudo killall -9 mysqld
Force InnoDB recovery on MySQL startup
Add a new (or edit an existing) MySQL configuration file within MAMP, instructing MySQL to force rebuild (broken) database index files on launch:
Add the new file named my.cnf
so it appears under /Applications/MAMP/conf/my.cnf
Within the my.cnf
file, add the following lines of text:
[mysqld]
innodb_force_recovery = 1
Now save the file & try to start MAMP’s MySQL service.
Important: remove the configuration line innodb_force_recovery
again, don’t keep this permanently active!
Remove the mysql57 ib_logfile
file(s)
Manually remove any “ib_logfile[NO]” from within MAMP’s /db/mysql57/
-folder:
/Applications/MAMP/db/mysql57/ib_logfile0
/Applications/MAMP/db/mysql57/ib_logfile1
/Applications/MAMP/db/mysql57/ib_logfile…
Also remove the mysql57 ibdata
file
In addition to removing the ib_logfile
files, also remove any ibdata files within MAMP’s /db/mysql57/
-folder:
/Applications/MAMP/db/mysql57/ibdata1
Recreate the MAMP tmp
folders
Remove and recreate the following MAMP /tmp/
-folder:
/Applications/MAMP/tmp/mysql
Now re-crate the same folder again – just as plain empty directories (e.g. with this command in the Terminal.app – or just do it in Finder):
mkdir /Applications/MAMP/tmp/mysql
Attention: do not delete the /tmp/php
-folder – or you will break MAMP PHP’s session handling!