1. System configuration information:
System MacOS bigsur 11.6
MySQL 8.0.26
2. Start MySQL service:
sudo /usr/local/mysql/support-files/mysql. server start
The error message is as follows:
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/jinjideleishen.local.pid).
Solution commands
mac default user is _mysql, under linux the default user of mysql is mysql
Use chown to change the owner of the specified file to the specified user or group
-R : Process all files in the specified directory and its subdirectories
sudo chown -R _mysql:_mysql /usr/local/mysql/
Restart successful:
sudo /usr/local/mysql/support-files/mysql.server restart
ERROR! MySQL server PID file could not be found!
Starting MySQL
.................................................... SUCCESS!
3. Stop MySQL service
sudo /usr/local/mysql/support-files/mysql.server stop
4. Restart MySQL service
sudo /usr/local/mysql/support-files/mysql.server restart