This is a solution to the following error occurring after an attempt to start mySQL server in Terminal:
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file
This solution worked for me for mySQL version 8.0.18 on macOS Mojave 10.14.6.
SOLUTION
Uninstall mySQL in System Preferences>Uninstall
Remove leftover files as described here: https://community.jaspersoft.com/wiki/uninstall-mysql-mac-os-x
Install mySQL again using dmg file. IMPORTANT: uncheck the button “Start mySQL upon the completion of this installation” (or something sounding like this).
Important: BEFORE starting mySQL server for the first time, ensure you as a user have appropriate permissions. In Terminal, type the following commands (use your username instead of user):
sudo chown -RL user /usr/local/mysql
chmod 777 /usr/local/mysql
sudo chown -RL user /usr/local/mysql/data
chmod 777 /usr/local/mysql/data
sudo chown -RL user /usr/local/mysql/bin
chmod 777 /usr/local/mysql/bin
- Start mySQL server by typing the command
/usr/local/mysql/support-files/mysql.server start
If you get the error
ERROR! MySQL server PID file could not be found!
Starting MySQL
. ERROR! The server quit without updating PID file (/usr/local/mysql/data/Users-MacBook-Pro.local.pid)
proceed as follows.
- Find the file
/usr/local/mysql/data/Users-MBP.hitronhub.pid
and open it in a text editor (there should be your user name instead of User in the name of the pid file). Your pid file may be under a different name, look for a pid file in /usr/local/mysql/data
or wherever your mysql/data
directory is housed. The path to the pid file may also be in the error message (see above).
Once you have located the pid file, open it in a text editor.
If the OS system does not give you permission to read the pid file, use the commands
sudo chown -RL user /usr/local/mysql/data/Users-MBP.hitronhub.pid
chmod 777 /usr/local/mysql/data/Users-MBP.hitronhub.pid
(again, use your username instead of user/User)
Once you open the file, you should see a number. That number denotes the process that your OS is running mySQL under. Copy that number. Then kill that process by typing
kill number
in Terminal.
- Start mySQL server by typing the command
/usr/local/mysql/support-files/mysql.server start
At this point, it worked for me.
Good luck!