4
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

posted at

updated at

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

現象

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 サービス名とすると良い

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
4
Help us understand the problem. What are the problem?