ERROR! MySQL manager or server PID file could not be found! QNAP

MysqlPidQnap

Mysql Problem Overview


I am having an issue where MySQL isn't starting on my QNAP NAS.

I found this first by not being able to log in through phpMyAdmin - was getting error:

#2002 Cannot log in to the MySQL server

I then went to attempt to start mysql, as I guess this is a common issue with this, but it just gave a generic error.

I went through troubleshooting the mysql.sock file and everything, changing its permissions, but nothing is working.

I have rebooted my NAS many times.

I eventually tried to restart mysql. In doing so I get:

ERROR! MySQL manager or server PID file could not be found!

I can't find anything specific to the QNAP or any general type troubleshooting for this. Everything I find seems to be OSX related.

Mysql Solutions


Solution 1 - Mysql

After a lot of searching, I was able to fix the "PID file cannot be found" issue on my machine. I'm on OS X 10.9.3 and installed mysql via Homebrew.

First, I found my PID file here:

/usr/local/var/mysql/{username}.pid

Next, I located my my.cnf file here:

/usr/local/Cellar/mysql/5.6.19/my.cnf

Finally, I added this line to the bottom of my.cnf:

pid-file = /usr/local/var/mysql/{username}.pid

Hopefully this works for someone else, and saves you a headache! Don't forget to replace {username} with your machine's name (jeffs-air-2 in my case).

Solution 2 - Mysql

I tried everything above, but saw no results until I got a hint from here: https://superuser.com/questions/159486/how-to-kill-process-in-mac-os-x-and-not-have-it-restart-on-its-own

I eventually went over to the activity monitor in my Mac, force Quit the PID, and ran the command:

sudo /usr/local/mysql/support-files/mysql.server restart

The magic was done!!!

Solution 3 - Mysql

If you have installed MySQL using brew the best way to go would be with homebrew

brew services restart mysql

after you run that command, all the problems that the update generated will be resolved

Solution 4 - Mysql

I ended up figuring this out on my own.

In searching for my logs I went into

cd /usr/local/mysql/var

In there I found the file named [MyNAS].pid (replace [MyNAS] with the name of your NAS.

I then ran the following to remove the file

rm -rf /usr/local/mysql/var/[MyNAS].pid

I then restarted mysql

[/usr/local/mysql/var] # /etc/init.d/mysqld.sh restart        
/mnt/ext/opt/mysql
/mnt/ext/opt/mysql
Try to shutting down MySQL
ERROR! MySQL manager or server PID file could not be found!
/mnt/ext/opt/mysql
Starting MySQL. SUCCESS! 

I tested everything and it all works like a charm again!

Solution 5 - Mysql

Run the below commands and it will work.

Go to terminal and type

sudo chown -RL root:mysql /usr/local/mysql

sudo chown -RL mysql:mysql /usr/local/mysql/data

sudo /usr/local/mysql/support-files/mysql.server start

Solution 6 - Mysql

Just run mysqld (don't run as root) from your terminal. Your mysql server will restart and reset everything like shown in the picture below:

enter image description here

And use a command like so:

mysql -u root -h 127.0.0.1

Solution 7 - Mysql

ERROR! MySQL server PID file could not be found!

This might be due to issues with disk space, disk inode usage or innodb corruption which may lead to the error.

The issue was with the pid file and the solution was:

  1. SSH login to server as a root

  2. Create directory /var/run/mysql

> mkdir /var/run/mysql

  1. Create a file with name as mysqld.pid

> touch mysqld.pid

  1. Change its ownership and group to mysql:mysql > chown mysql:mysql mysqld.pid

  2. Restart MySQL service

Done!

Solution 8 - Mysql

I had the same issue. It turns out I added incorrect variables to the my.cnf file. Once I removed them and restarted mysql started with no issue.

Solution 9 - Mysql

Check if your server is full first, thats a common reason (can't create the PID file because you have no space). Run this to check your disk usage..

df -h

If you get something like this, you are full..

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        40G   40G  6.3M 100% /

In that case, you need to start looking for what to delete to make room, or add an additional drive to your server.

Solution 10 - Mysql

Nothing of this worked for me. I tried everything and nothing worked.

I just did :

brew unlink mysql && brew install mariadb

My concern was if I would lost all the data, but luckily everything was there.

Hope it works for somebody else

Solution 11 - Mysql

Note: If you just want to stop MySQL server, this might be helpful. In my case, it kept on restarting as soon as I killed the process using PID. Also brew stop command didn't work as I installed without using homebrew. Then I went to mac system preferences and we have MySQL installed there. Just open it and stop the MySQL server and you're done. Here in the screenshot, you can find MySQL in bottom of system preferences.enter image description here

Solution 12 - Mysql

I have the same problem. I found the file {username}.local.err instead of {username}.local.pid inside /usr/local/mysql, then i changed the name *.err to *.pid and it works fine.
Starting MySQL. SUCCESS!

My OS El Capitan 10.11.5

Solution 13 - Mysql

I know this is an older post, but I ran into the ERROR! MySQL server PID file could not be found! when trying to start MySQL after making an update to my.cnf file. I did the following to resolve the issue:

  1. Deleted my experimental update to my.cnf

  2. Deleted the .net.pid and .net.err files.

delete /usr/local/var/mysql/**<YourUserName>**-MBP.airstreamcomm.net.*

3. Ensured all MySQL processes are stopped.

ps -ax | grep mysql
kill **<process id>**

4. Started MySQL server as normal.

mysql.server start

Solution 14 - Mysql

First find PID of mysql service

ps aux | grep mysql

Then, you have to kill process

 sudo kill <pid>

After you again start mysql service

mysql.server start

Solution 15 - Mysql

After doing setup of PHPMyAdmin, I was also facing the same problem,

Something . Like this

  • Then I just stopped the MYSQL server by going into System settings, and then started again, and it worked.

Solution 16 - Mysql

root@host [~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/host.pxx.com.pid).

root@host [~]# vim /etc/my.cnf
Add Line in my.cnf its working know
innodb_file_per_table=1
innodb_force_recovery = 1

Result

root@host [~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL……….. [ OK ]
root@host [~]# service mysql restart
Shutting down MySQL…. [ OK ]
Starting MySQL. [ OK ]

Source

Solution 17 - Mysql

screenshot

If you're using MySQL Workbench, the mysql.server stop/restart/start will not work.

You will need to login into the workbench and then click "shutdown server". See image attached.

Solution 18 - Mysql

I was able to solve this on OS X by shutting down the existing mysql.server that was running:

mysql.server stop

The starting:

mysql.server start

From there I could run mysql.server restart without throwing the ERROR.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionadprocasView Question on Stackoverflow
Solution 1 - MysqljeffwtribbleView Answer on Stackoverflow
Solution 2 - MysqlYoosaf AbdullaView Answer on Stackoverflow
Solution 3 - MysqlAlvaro MenaView Answer on Stackoverflow
Solution 4 - MysqladprocasView Answer on Stackoverflow
Solution 5 - MysqlShabeerView Answer on Stackoverflow
Solution 6 - MysqlAdrian Cid AlmaguerView Answer on Stackoverflow
Solution 7 - MysqlAfrizalView Answer on Stackoverflow
Solution 8 - Mysqluser3924460View Answer on Stackoverflow
Solution 9 - MysqlP-DidzView Answer on Stackoverflow
Solution 10 - MysqlAlejandro GiraldoView Answer on Stackoverflow
Solution 11 - MysqlAbhijeet KhangarotView Answer on Stackoverflow
Solution 12 - MysqlphzaoView Answer on Stackoverflow
Solution 13 - MysqleleckctraView Answer on Stackoverflow
Solution 14 - MysqlTuran ZamanlıView Answer on Stackoverflow
Solution 15 - Mysqlhardik chughView Answer on Stackoverflow
Solution 16 - MysqlEngineer Jai MishraView Answer on Stackoverflow
Solution 17 - MysqlJohn KarasevView Answer on Stackoverflow
Solution 18 - MysqlKevin LearyView Answer on Stackoverflow