Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|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

1 Answer 1

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.

share|improve this answer
    
netstat: option -p requires an argument –  Almo Dec 17 '13 at 20:59
    
It does not require an argument on the net-tools version of netstat on Linux. What OS are you running on? I know netstat has different syntax/options on Windows, and on BSD. –  Zoredache Dec 17 '13 at 21:07
    
Ah, ok. Thanks. :) –  Almo Dec 18 '13 at 0:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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