Search code examples
mysqlhomebrewmacos-mojave

brew mysqld not starting


Mac OSX Mojave. I have mysql@5.6 installed with brew. I have run brew link --force mysql@5.6.

$ cat /Users/me/Library/LaunchAgents/homebrew.mxcl.mysql@5.6.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@5.6</string>
  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/opt/mysql@5.6/bin/mysqld_safe</string>
    <string>--datadir=/usr/local/var/mysql</string>
  </array>
  <key>RunAtLoad</key>
  <true/>
  <key>WorkingDirectory</key>
  <string>/usr/local/var/mysql</string>
</dict>
</plist>

If I run /usr/local/opt/mysql@5.6/bin/mysqld_safe from the terminal directly, mysqld starts. If I try running brew services restart mysql@5.6, it does not (but brew says it does - but it appears yellow in brew services list).

What is going on?


Solution

  • I had this issue with brew nginx package. Running it with sudo worked for me.

    Try running:

    sudo brew services restart mysql@5.6