MySQL ERROR! The server quit without updating PID file

janac
2 min readMay 7, 2020

I installed MySQL using brew. Suddenly, after running mysql.start I get the following error:

jmeena@Js-MacBook-Pro /usr/local/var % mysql.server startStarting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Js-MacBook-Pro.local.pid).

In the logs, I would see:

Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock

Solution 1: Change ownership of the MySQL folder

This solution is very popular on StackOverflow:

jmeena@Js-MacBook-Pro /usr/local/var % sudo chown -R _mysql:_mysql mysql

You can check which user has permission by running ls -la and looking at the first few columns. The correct user is the _mysql or home user, not admin.

Solution 2: Change permissions of the MySQL folder

jmeena@Js-MacBook-Pro % sudo chmod 777 /usr/local/var/mysql

Solution 3: Change permissions of the MySQL folder

jmeena@Js-MacBook-Pro % sudo chmod 777 /usr/local/var/

Solution 4:

Check your config file. You can find the location of your config file by:

mysql --verbose --help | grep my.cnf

Multiple file names will be printed, and you will need to check each one.

Solution 5: Removal MySQL Completely

In one case, none of the above worked for me. I had to remove MySQL completely and reinstall. Also, since I installed using brew, I need to be careful to run MySQL only as a brew service, and not directly, i.e. do NOT use sudo /usr/local/mysql/support-files/mysql.server start

Instead, run `brew services start mysql@5.7` of course, changing 5.7 to your version number.

  1. Check if MySQL is running
ps -ef | grep ‘[m]ysql’

2. If so, then stop them using

brew services stop mysql@5.7

3. Check if they are gone now

ps -ef | grep ‘[m]ysql’

4. If not, try

mysql.server stop

--

--

janac

Most of my writing is about software. I enjoy summarizing and analyzing books and self-help videos. I am senior software consultant at LazerTechnologies.com.