I want to enable remote access to my MySQL server so I've set the bind-address option under [mysqld], which looks like:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
bind-address=**.**.**.66
port=3306
# skip-networking
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

When I comment bind-address, the server starts normally. However, when I comment it out it won't restart. The port is open and listens.

Can you please help me sort this out? Thanks

link|improve this question
**.**.**.66 isn't a valid IP address... – womble Jul 19 '11 at 0:38
@womble, eh? Isn't that just standard address obfuscation? – Zoredache Jul 19 '11 at 0:41
@Zoredache: We don't know, do we? Perhaps that really is what he put in, and that's why it's not working. The correct way to obfuscate addresses is to use the RFC5737 documentation networks. – womble Jul 19 '11 at 0:43
Probably I should clarify this, in the actual my.cnf file I use the real IP address. I use * just to hide it here. – Vasilis Jul 19 '11 at 1:10
feedback

1 Answer

Why do you think you need to use bind-address to enable remote access?

Without the bind-address option try running the command netstat -ntlp | grep 3306. If you see output like below, then mysql is listening on every IP associated with the computer.

tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      23465/mysqld 

You only really need the bind-address if you want to listen on a specific IP. If you want to listen for requests on all addresses you should leave that commented out or set it to 0.0.0.0. Some packaged versions of mysql come with startup/maintenance scripts that will attempt to access mysql on 127.0.0.1. If you use the bind-address option then mysql will only be bound to that specific IP, and nothing else, possibly breaking any scripts that you currently have.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.