LoginSignup
7
5

More than 3 years have passed since last update.

brewでインストールしたmysqlが勝手に再起動するのを直す

Last updated at Posted at 2018-04-20

現象

brewでインストールしたmysqlがmysql.server stopしてもpidを変えて再起動してくる.

❯ mysql.server status
 SUCCESS! MySQL running (28216)

❯ mysql.server stop
Shutting down MySQL
.. SUCCESS!

❯ mysql.server status
 SUCCESS! MySQL running (28667)

原因

macにはlaunchctlという仕組みがあり,plist定義を作っておくと,自動でデーモンを起動してくれる.これにmysqlが定義されていた.

❯ launchctl list | grep mysql
30154   0       homebrew.mxcl.mysql

対処

以下のコマンドでlaunchctlの管理から除外できる.

❯ brew services stop mysql
Stopping `mysql`... (might take a while)
==> Successfully stopped `mysql` (label: homebrew.mxcl.mysql)

※再度登録はbrew services start サービス名とすると良い

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