mysql starts fine, everything is working as expected, but there is no pid file where my.cnf says it should be, the .sock is there

this is the relevant section of my.cnf

user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock


/var/run/mysqld# ls

ps aux...

ps aux | grep mysql
mysql    23990  0.1  4.4 887340 75904 ?        Ssl  17:25   0:01 /usr/sbin/mysqld

Again, everything works, but i need the pid so that God can monitor it

  • Old bug from 2008 where someone got the PID created after another restart or stop+start: http://bugs.mysql.com/bug.php?id=41067

  • Normally I see an error when that file is not there ...

  • But a possible solution (1st shutdown mysql)...

    cd /var/run/mysqld/
    sudo touch mysqld.pid
    sudo chown mysql:mysql mysqld.pid

    Unless you want actually have it created by the deamon (but I would consider it a bug).

  • -.- yup that did it, restarted twice and it did update the file, thanks
    – geermc4
    Apr 23 '13 at 18:05
  • oh so the 1st one worked? Weiiiiiiiiird :D
    – Rinzwind
    Apr 23 '13 at 18:06
  • no creating the file for it worked, didn't even need to stop it, just restarted and it used the file (i've restarted before the file and no change, so for some reason it couldn't create it)
    – geermc4
    Apr 23 '13 at 18:08
  • noup, something's up, gone again, maybe even my god config
    – geermc4
    Apr 23 '13 at 18:10
  • Check your mysql script. is there anything special in it? Like "su mysql -c "exec /usr/local/mysql/libexec/mysqld" &"?
    – Rinzwind
    Apr 23 '13 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.