Mysql 5.6 server via MacPorts won't start

4

3

I've been happily using MacPorts' mysql5 and mysql5-server. Now it's time to upgrade. I followed standard procedure, but the server won't start.

sudo port unload mysql5
sudo port install mysql56 mysql56-server mysql_select
sudo port select -set mysql mysql56
sudo port load mysql56-server

No errors. When I run ps aux | grep sql I see it's not running. I tried setting the socket in my.conf and running mysql5_install_db (but that seems specific to the older package). File permissions look correct. There's no mysql error log yet. How do I get this server started?

Matt S

Posted 2013-08-09T18:45:22.730

Reputation: 372

Answers

5

Figured it out. Opened LaunchDaemon plist file to see the exact command which would run. Ran that manually to see the startup output and eventually came up with the solution:

sudo mysql_install_db5 --datadir=/opt/local/var/db/mysql56
sudo chown -R _mysql:_mysql /opt/local/var/db/mysql56/
sudo mysql_upgrade

If you need help tracking down startup errors, open Console and messages containing "mysql". In my case the process was quickly closing, causing an infinite loop of retries. To dig deeper, open this file to see how it's launched:

/Library/LaunchDaemons/org.macports.mysql56-server.plist

From there we can see it basically runs

/opt/local/bin/daemondo --label=mysql56-server --start-cmd /opt/local/lib/mysql56/bin/mysqld --user=_mysql

So at the command line try

sudo -u _mysql /opt/local/lib/mysql56/bin/mysqld

and watch the startup output.

Matt S

Posted 2013-08-09T18:45:22.730

Reputation: 372

1Be careful with mysql binaries with a "5" as suffix. They belong to the mysql5-server package (the old 5.1.x version!). After mysql_select binaries without suffix are symlinked to the mysql56-server distribution (see "ls -lah /opt/local/bin/mysql*"). Make sure you use these. – Paul Voss – 2014-08-25T14:42:24.233

This worked great for me, I was having the exact same problem. Where is the LaunchDaemon plist file located? – chattsm – 2013-08-09T20:52:33.177

@m.p.c I edited my answer with more details. – Matt S – 2013-08-09T21:08:25.913