Mac系统下MAMP PRO中MySQL无法启动的问题求助(附错误日志)
First, let's break down the hints from your error log and work through common fixes for this problem:
Your Error Log Snippet
180505 14:15:26 mysqld_safe Logging to '/Applications/MAMP/logs/mysql_error.log'.
180505 14:15:26 mysqld_safe Starting mysqld daemon with databases from /Library/Application Support/appsolute/MAMP PRO/db/mysql56
2018-05-05 14:15:27 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
1. Fix the TIMESTAMP Deprecation Warning
This warning can sometimes cause MySQL to abort silently. Let's update the config to resolve it:
- Open MAMP PRO and navigate to the MySQL tab
- Click the my.cnf Template button
- Add this line under the
[mysqld]section:explicit_defaults_for_timestamp = 1 - Save the template, then restart MAMP PRO entirely.
2. Fix Database Directory Permissions
Incorrect permissions on MAMP's database folder are a common culprit:
- Open Terminal and run these commands (replace
mysql56with your actual MySQL version if it's different):sudo chown -R _mysql:_mysql /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56 sudo chmod -R 755 /Library/Application\ Support/appsolute/MAMP\ PRO/db/mysql56 - Enter your Mac password when prompted, then try starting MySQL again in MAMP PRO.
3. Check for Port Conflicts
Another MySQL instance (like the default one that comes with some Macs) might be using port 3306, blocking MAMP's MySQL:
- In Terminal, run:
lsof -i :3306 - If a process shows up, kill it with:
(Replacesudo kill -9 [PID][PID]with the process ID from the lsof output) - Restart MAMP PRO after killing the process.
4. Inspect the Full Error Log
The snippet you shared only shows the start of the log. The real failure reason is likely further down:
- Open
/Applications/MAMP/logs/mysql_error.logwith TextEdit or run:cat /Applications/MAMP/logs/mysql_error.log - Look for lines starting with
[ERROR]— these will point to the exact issue (corrupted tables, missing files, etc.).
If none of these steps resolve the problem, share the full error log and we can troubleshoot further!
内容的提问来源于stack exchange,提问作者Alessio Biscotto

