You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级Mac High Sierra 10.13.2后MAMP/AMPPS/XAMPP中MySQL Server无法启动求助

Troubleshooting MySQL Startup Issues After Mac High Sierra 10.13.2 Upgrade

Hey there, let’s work through this frustrating MySQL problem you’re dealing with—since it’s happening across MAMP, AMPPS, and XAMPP, it’s clearly a system-level conflict or leftover issue from the OS upgrade, not just a single stack problem. Here’s a step-by-step breakdown to fix it:

1. Check for Conflicting System-Level MySQL Processes

Mac High Sierra might have a pre-installed or leftover MySQL daemon running in the background that’s hogging the 3306 port or interfering with your AMP stack’s MySQL.

  • First, list all running mysqld processes:

    ps aux | grep mysqld
    

    Look for any processes owned by root or _mysql that aren’t tied to your MAMP/AMPPS/XAMPP installation (the paths should show something like /Applications/MAMP/Library/bin/mysqld for MAMP).

  • If you find an unrecognized mysqld process, stop it by unloading its launch daemon:

    # Replace with the actual plist file name if different
    sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.mysqld.plist
    

    Common plist names include com.oracle.oss.mysql.mysqld.plist or com.mysql.mysql.plist—check the /Library/LaunchDaemons/ folder for any MySQL-related files.

2. Inspect MySQL Error Logs for Exact Failures

The error log will tell you why MySQL won’t start—this is the most critical step. Here’s where to find logs for each stack:

  • MAMP: /Applications/MAMP/logs/mysql_error_log.err
  • XAMPP: /Applications/XAMPP/xamppfiles/var/mysql/[your-mac-hostname].err
  • AMPPS: /Applications/AMPPS/logs/mysql.err

Open the log file and look for recent entries (towards the bottom). Common issues you might see:

  • Permission errors on data directories
  • Corrupted InnoDB log files
  • Port conflicts
  • Invalid configuration settings in my.cnf

3. Fix Directory Permission Issues

OS upgrades often reset file permissions, which can prevent MySQL from accessing its data or log files.

  • Locate your MySQL data directory:

    • MAMP: /Applications/MAMP/db/mysql
    • XAMPP: /Applications/XAMPP/xamppfiles/var/mysql
    • AMPPS: /Applications/AMPPS/mysql/data
  • Set the correct owner and permissions for the directory:

    # Replace [data-directory-path] with the actual path above
    sudo chown -R _mysql:_mysql [data-directory-path]
    sudo chmod -R 755 [data-directory-path]
    

4. Validate and Adjust MySQL Configuration (my.cnf)

Outdated or incompatible settings in my.cnf can break startup after an OS upgrade.

  • Find your my.cnf file:

    • MAMP: /Applications/MAMP/conf/my.cnf
    • XAMPP: /Applications/XAMPP/xamppfiles/etc/my.cnf
    • AMPPS: /Applications/AMPPS/mysql/etc/my.cnf
  • Check these key settings:

    • innodb_log_file_size: If you previously deleted ib_logfile0/ib_logfile1, make sure this value matches what MySQL expects (or comment it out temporarily to let MySQL auto-generate the correct log file size).
    • bind-address: Ensure it’s set to 127.0.0.1 (local only) to avoid network conflicts.
    • port: Confirm it’s set to 3306 (or a different port if you intentionally changed it, but make sure no other process is using that port).

5. Fully Clean Up MySQL Residues Before Reinstalling

If reinstalling stacks didn’t work, leftover system files are likely causing the issue. Uninstall your current AMP stack, then delete these MySQL-related files/folders:

  • /Library/LaunchDaemons/: Any MySQL .plist files
  • /Library/StartupItems/MySQLCOM (if it exists)
  • /usr/local/mysql (if this folder exists)
  • ~/Library/Application Support/: MAMP/AMPPS/XAMPP folders
  • /var/db/receipts/: Any MySQL-related .pkg receipt files

After deleting all residues, restart your Mac, then reinstall your preferred AMP stack.

6. Verify Port 3306 Isn’t Occupied by Another App

Use this command to check if any process is using port 3306:

sudo lsof -i :3306

If you see a process other than your AMP stack’s MySQL, kill it with:

sudo kill -9 [PID]

(Replace [PID] with the process ID from the lsof output.)


内容的提问来源于stack exchange,提问作者fransBernhard

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 08:05:39