Macos – MySQL binds to port 3307 not port 3306

macosMySQL

I am running OS X Yosemite 10.10.5 on a late-2014 Mac Mini. It's my development server. I've just installed MySQL on this machine: 'mysql –version' reports the version is 'mysql Ver 14.14 Distrib 5.6.26, for osx10.8 (x86_64) using EditLine wrapper'. I definitely downloaded and installed the "OS X 10.9" version however (I just re-checked the DMG file).

Anyway I'm trying to make the product listen on port 3306 as normal and I'm having some difficulty making it do it. By default it seems to be bound to port 3307, even when my.cnf looks like this:

[mysqld]
bind-address = 0.0.0.0
port         = 3306
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

(the last line was already in the default one in /usr/local/mysql/)

looking at the running process I can see the command line (ps ax | grep mysql) has been given as 3307:

40958   ??  Ss     0:00.38 /usr/local/mysql/bin/mysqld \\
--user=_mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data \\
--plugin-dir=/usr/local/mysql/lib/plugin \\
--log-error=/usr/local/mysql/data/mysqld.local.err \\
--pid-file=/usr/local/mysql/data/mysqld.local.pid --port=3307

(I'm starting and stopping it currently with the MySQL system preference panel not directly off the command line)

To access it from the client I must explicitly set the port on the command line

$ mysql -u smcphee -h 192.168.x.x -P 3307 -p

For kicks, I edited the my.cnf to specify some other random port. The server is still binding to port 3307. I can't find any other my.cnf on the disk anywhere that may be overriding it.

What is going on here?

Best Answer

Can you try to check if the following file exists in your machine?

/Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist

Check if the port is define on 3307, if this is true change to 3306 and restart the service.

Related Question