LoginSignup
1
2

More than 5 years have passed since last update.

homebrewで入れたmysql, LauchAgentsで管理してたけど止めたいとき

Last updated at Posted at 2016-07-07
>>> mysql.server stop                                                
Shutting down MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/hoge.pid).

pidファイル updateできないのでエラーになったので

>>> open ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>KeepAlive</key>
  <true/>
  <key>Label</key>
  <string>homebrew.mxcl.mysql</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/mysql/bin/mysqld_safe</string>
    <string>--bind-address=127.0.0.1</string>
    <string>--datadir=/usr/local/var/mysql</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local/var/mysql</string>
    <key>UserName</key>
    <string>koichi.yanagimoto</string>
</dict>
</plist>

が出てくるので、

<key>KeepAlive</key>
  <false/>

にします。

>>> launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

>>> launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist

して、

>>> mysql.server stop

Shutting down MySQL
.. SUCCESS!

SUCCESS!

1
2
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
1
2