LoginSignup
4
5

More than 3 years have passed since last update.

MySQLが起動しないエラー (The server quit without updating PID file)

Posted at

mysql起動時に下記エラー発生

$ mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/XXXX.pid).

https://qiita.com/akiko-pusu/items/aef52b723da2cb5dc596
↑記事を参考に一旦アンインストールして再インストールしました。

一度、5.6をインストールした後、8.0を使いたいと思い、またアンインストール&再インストールしました。

起動してみると、

$ mysql.server start
-bash: /usr/local/opt/mysql@5.6/bin/mysql.server: No such file or directory

パスが5.6のままで起動できませんでした。

自分はbashを使用していたので、.bashrcファイルにパスを通しました。
(zshを利用されている方は、.zshrcです)

$ vi ~/.bashrc
export PATH=/usr/local/opt/mysql@8.0/bin/:$PATH

$ source ~/.bashrc 

再度起動してみると、

$ mysql.server start
Starting MySQL
... ERROR! The server quit without updating PID file (/usr/local/var/mysql/XXXX.pid).

同じエラーが再発しました。

次に、プロセスを確認

$ ps -ef | grep mysql
  501   699     1   0 16 720  ??         0:00.04 /bin/sh /usr/local/opt/mysql@5.6/bin/mysqld_safe --datadir=/usr/local/var/mysql
  501   974   699   0 16 720  ??         1:06.51 /usr/local/opt/mysql@5.6/bin/mysqld --basedir=/usr/local/opt/mysql@5.6 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/opt/mysql@5.6/lib/plugin --log-error=XXXX-Air.local.err --pid-file=XXXX-Air.local.pid
  501  3524 81032   0  1:48AM ttys002    0:00.00 grep mysql

5.6が起動してるので、強制終了(-9)する
(974は上記のプロセスID)

$ kill -9 974

再々チャレンジ!!

$ mysql.server start
Starting MySQL
.. SUCCESS!

成功!!

4
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
5