MySQL数据库无法启动 - 错误! 服务器退出而不更新PID文件 - XAMPP OS X.

I'm using XAMPP on OS X Maveriks and I'm running XAMPP to have MySQL and Apache.

It was running great and no problem but today when I tried to run MySQL from os-x-manager, it says Starting then Stopped.

I searched and used this command in terminal :

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

it gives the following error:

Starting MySQL . ERROR! The server quit without updating PID file (/Applications/XAMPP/xamppfiles/var/mysql/Boshras-MacBook-Pro.local.pid).

I searched for the PID file, it wasn't found, i created it using and rm *.local.err before it

touch Boshras-MacBook-Pro.local.pid

but the pid file disappears every time i try to start MySQL. Any help would be appreciated.

Use SUDO

sudo /Applications/XAMPP/xamppfiles/bin/mysql.server start

Maybe mysql does not have permission to the folder where the pid file is located in.

Solution working for my case:

  1. Check your error log at /Applications/XAMPP/xamppfiles/var/mysql/Boshras-MacBook-Pro.local.err

  2. If there is something like this in the log: ...[Note] Unable to delete pid file: Permission denied..., which means mysql does not have the permission to your mysql folder

  3. Use the following command in terminal to grant the permission: sudo chown -R mysql /Applications/XAMPP/xamppfiles/var/mysql