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

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.

This question is related to mysql pid qnap

The answer is


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


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


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

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


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


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

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.


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

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

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.


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.

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


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.


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).


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.*
  1. Ensured all MySQL processes are stopped.
ps -ax | grep mysql
kill **<process id>**
  1. Started MySQL server as normal.
mysql.server start

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.


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


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


Examples related to mysql

Implement specialization in ER diagram How to post query parameters with Axios? PHP with MySQL 8.0+ error: The server requested authentication method unknown to the client Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver' phpMyAdmin - Error > Incorrect format parameter? Authentication plugin 'caching_sha2_password' is not supported How to resolve Unable to load authentication plugin 'caching_sha2_password' issue Connection Java-MySql : Public Key Retrieval is not allowed How to grant all privileges to root user in MySQL 8.0 MySQL 8.0 - Client does not support authentication protocol requested by server; consider upgrading MySQL client

Examples related to pid

How to get PID by process name? Why is $$ returning the same id as the parent process? How to get PID of process by specifying process name and store it in a variable to use further? ERROR! MySQL manager or server PID file could not be found! QNAP How to get the PID of a process by giving the process name in Mac OS X ? Determine the process pid listening on a certain port What is a .pid file and what does it contain? How to get PID of process I've just started within java program? How to check if a process id (PID) exists How does a Linux/Unix Bash script know its own PID?

Examples related to qnap

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