问题
I have problems with MySQL on my MacBook. I had updated my OS from Yosemite to El Capitan before I installed MySQL server.
Now, when I try to run MySQL on Terminal, I got the error like this
ERROR! The server quit without updating PID file
Anyone can help me please? Thanks a lot!
回答1:
Try updating your my.cnf file to set the location of the PID file manually. Here's how you do that.
In your Terminal run the following command.
ps -ax | grep mysql
This will list all the locations of the important mysql files. Look for the path of the --pid-file
I will look something like this:
--pid-file=/path/to/your/local/mysqld.local.pid
Copy the path of the mysqld.local.pid file
Next open your my.cnf file using nano
sudo nano /usr/local/mysql/my.cnf
Set the pid-file path at the end of your my.cnf file. Search for pid-file. If you can't find it, manually enter it at the end of your my.cnf file. This will tell mysql where to look for the PID file. Enter the path that you copied like the example below.
pid-file = /path/to/your/local/mysqld.local.pid
Close and save the file
Next restart mysql. You may need to do this twice to reset your PID error.
sudo /usr/local/mysql/support-files/mysql.server start
That should solve your problem! Good luck
回答2:
I had to create the file my.cnf in /etc and add [mysqld] before the line pid-file = /path/to/your/local/mysqld.local.pid Finally it worked!
来源:https://stackoverflow.com/questions/33225652/mysql-error-on-el-capitan-os-after-yosemite-os-update