Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question
up vote 2 down vote accepted
  • Old bug from 2008 where someone got the PID created after another restart or stop+start:

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

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

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

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

share|improve this answer
-.- 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 posting your answer, you agree to the privacy policy and terms of service.

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