Mysql – Mac OS X 10.10 theSQL 5.6.26 accessible from CLI but not port 3306

mac os xMySQL

I did a fresh install of mySQL 5.6.26 on my Mac today. I was able to access mySQL from as expected, however I could not get mySQL workbench to attach to port 3306. What really tripped me up was I could not connect to this port even locally (nc -z 3306).

long story short, the mySQL system preference pane created a launch Daemon for mySQL on port 3307. /Library/LaunchDaemons/

I'm not sure why this is… every other install I've done was on 3306. Just though I'd drop a note to save others from needlessly digging into why OS X's firewall was "blocking" the port when it really was't. Also, it seems this LD will override the port in my.cnf, even if it is hard coded to 3306.

Hope this helps!

bash-3.2# defaults read /Library/LaunchDaemons/ 
    Disabled = 0;
    ExitTimeOut = 600;
    GroupName = "_mysql";
    KeepAlive = 1;
    Label = "";
    LaunchOnlyOnce = 0;
    ProcessType = Interactive;
    Program = "/usr/local/mysql/bin/mysqld";
    ProgramArguments =     (
    RunAtLoad = 1;
    SessionCreate = 1;
    UserName = "_mysql";
    WorkingDirectory = "/usr/local/mysql";

Best Answer

I had this same problem too, and changing the port in /Library/LaunchDaemons/ fixed the issue, with no side effects so far.

Changing the port in my.cnf didn't work. It makes the Preference Pane say that MySQL is not running, and makes it impossible to start from the Preference Pane.