At one point I had to restart MySQL (which up to this point was running fine), and received this error:
$ sudo /usr/share/mysql/mysql.server start Starting MySQL ................................................................. ERROR! Manager of pid-file quit without updating file.
After a good 20 minutes spent on Google trying various things (hunting down the mysql.plugin file to verify its permissions, removing my my.cnf file, verifying my .pid file was getting erased, etc), I finally stumbled upon the answer: MySQL was still running under a different hostname.
It happened like this
- At home, my computer’s hostname was set to SDF1.local
- I put my computer to sleep, MySQL remained running
- When I got to work, my computer’s hostname changed to laptop-134.workdomain
- When I issued the MySQL restart command, mysql.server sent the shutdown command (and subsequent start command) using my current hostname, laptop-134.workdomain — but the current mysqld process was running under my old hostname of SDF1.local.
Bash shows the remnants of the battle:
$ ls -l /var/lib/mysql/ total 41128 -rw-rw---- 1 _mysql _mysql 15566 Aug 14 23:20 Gabriels-MacBook.local.err -rw-rw---- 1 _mysql _mysql 771 Aug 15 21:18 SDF1.local.err -rw-rw---- 1 _mysql _mysql 5 Aug 15 21:17 SDF1.local.pid ... snip ... -rw-rw---- 1 _mysql _mysql 53778 Aug 16 12:33 laptop-134.workdomain.err ... snip ...
In the Terminal, saw the current running mysqld process and took note of the process ID:
$ ps aux | grep mysql | grep -v grep _mysql 1929 0.0 0.4 2502344 18788 s000 S 9:17PM 0:21.13 /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql5 --user=_mysql --log-error=/opt/local/var/db/mysql5/SDF1.local.err --pid-file=/opt/local/var/db/mysql5/SDF1.local.pid --socket=/opt/local/var/run/mysql5/mysqld.sock --port=3306 root 1837 0.0 0.0 2435464 856 s000 S 9:17PM 0:00.03 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe --datadir=/opt/local/var/db/mysql5 --pid-file=/opt/local/var/db/mysql5/SDF1.local.pid
Killed the process that was running with the _mysql user:
$ sudo kill 1929
$ sudo /usr/share/mysql/mysql.server start Starting MySQL . SUCCESS!