The MySql server PID file could not be found error occurs when MySQL cannot find the PID file. It may also occur if the MySQL process is killed abruptly. Since the process does not end properly, the PID file is mismatched.
PID-file and create /var/run/mysqld/Check where your PID-file points to. You can do this by running:
my.cnf
If the parameter is not present, set it as shown below:
pid-file = /var/run/mysqld/mysqld.pid
Next, create the following directory and give it the appropriate permissions, as follows:
mkdir /var/run/mysqld
touch /var/run/mysqld/mysqld.pid
chown -R mysql:mysql /var/run/mysqld
MySQL folderChange the ownership of the MySQL folder:
sudo chown -R _mysql:_mysql mysql
MySQL folderYou can change the permissions of the MySQL folder by typing:
sudo chmod 777 /usr/local/var/mysql
If the above solutions do not work, try changing the permissions of /usr/local/var by typing:
sudo chmod 777 /usr/local/var
Free Resources