MySQL - Can't turn off skip-networking

2

I'm trying to configure a freshly installed mysql server to listen on port 3306.

I've removed skip_networking, I have bind-address=127.0.0.1 and it completely ignores the config...

When I try SHOW VARIABLES LIKE 'skip_networking' I see it's still frustratingly ON.

netstat -na | grep mysql indicates it's listening on a random port, and yes, I do have port=3306 configured... Exact line is: unix 2 [ ACC ] STREAM LISTENING 45816 /var/run/mysqld/mysq d.sock

Running on Ubuntu 12.04.2

Am I missing something REALLY obvious?

Yariv Livay

Posted 2013-04-05T20:28:04.953

Reputation: 21

Are you certain you are editing the correct config file? This has bitten me maaaaany times. – Brian Adkins – 2013-04-05T21:42:34.637

Answers

5

On OSX system using macports

First kill your server if it is running.

mysqladmin shutdown -u root -p

Then Disable skip-networking from:

/opt/local/etc/mysql<YOUR_VERSION>/macports-default.cnf

Comment out the skip-networking line:

# skip-networking

Finally relaunch the server.

mysql -u root -p

Freeman

Posted 2013-04-05T20:28:04.953

Reputation: 315

The documentation states that macport-default.cnf will be replaced on next upgrade hence the need to override and not just modify. – VdesmedT – 2016-07-23T07:52:50.820

0

The issue stems from your use of netstat. The clue is that your sample output starts with "unix" instead of "tcp" (i.e., it's a Unix socket, vice a network port). Instead of "netstat -an", try "netstat -antup" and grep for "mysql" or "LISTEN".

In other words, MySQL is no longer listening on a network port. What you're seeing is a Unix socket, which isn't accessible from the network. (Hope this helps.)

joat

Posted 2013-04-05T20:28:04.953

Reputation: 466