ERROR! MySQL manager or server PID file could not

2019-01-16 12:05发布

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 pid qnap
14条回答
ゆ 、 Hurt°
2楼-- · 2019-01-16 12:37

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!!!

查看更多
家丑人穷心不美
3楼-- · 2019-01-16 12:39

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.

查看更多
淡お忘
4楼-- · 2019-01-16 12:43

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.

查看更多
爷、活的狠高调
5楼-- · 2019-01-16 12:48

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
查看更多
Luminary・发光体
6楼-- · 2019-01-16 12:50

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!

查看更多
疯言疯语
7楼-- · 2019-01-16 12:52

I have the same problem. I found the file {username}.local.err instead {username}.local.pid inside the /usr/local/mysql then i change the name *.err for *.pid and work fine. Starting MySQL SUCCESS!

My OS El Capitan 10.11.5

查看更多
登录 后发表回答