[Ruby] ERROR! MySQL server PID file could not be found!

less than 1 minute read

[email protected] memopy % mysql.server start
Starting MySQL
......
.^C
[email protected] memopy % mysql.server stop 
 ERROR! MySQL server PID file could not be found!

[email protected] memopy % ls -la /usr/local/var/mysql/MacBook-Air.local.pid
ls: /usr/local/var/mysql/MacBook-Air.local.pid: No such file or directory

[email protected] memopy % mysql.server status
 ERROR! Multiple MySQL running but PID file could not be found (14996 15095 )
[email protected] memopy % ps ax | grep mysql
14996 s001  S      0:00.03 /bin/sh /usr/local/Cellar/[email protected]/5.7.29/bin/mysqld_safe --datadir=/usr/local/var/mysql --pid-file=/usr/local/var/mysql/MacBook-Air.pid
15095 s001  S      0:05.78 /usr/local/Cellar/[email protected]/5.7.29/bin/mysqld --basedir=/usr/local/Cellar/[email protected]/5.7.29 --datadir=/usr/local/var/mysql --plugin-dir=/usr/local/Cellar/[email protected]/5.7.29/lib/plugin --log-error=MacBook-Air.err --pid-file=/usr/local/var/mysql/MacBook-Air.pid
18863 s001  R+     0:00.00 grep mysql
[email protected] memopy % kill 14996
[email protected] memopy % kill 15095
[email protected] memopy % ps ax | grep mysql
18876 s001  S+     0:00.01 grep mysql
[email protected] memopy % mysql.server status
 ERROR! MySQL is not running
[email protected] memopy % mysql.server start 
Starting MySQL
. SUCCESS! 
[email protected] memopy % mysql.server status
 SUCCESS! MySQL running (18991)

https://qiita.com/avicii2314/items/cbe938339cb80f59f5a5

https://www.atmarkit.co.jp/ait/articles/1603/28/news022.html

https://qiita.com/YamKenta/items/a33499a7db7946a43381