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 have a MySQL database set up on a server, I've created a user and granted all privileges to that user from any address but I can't connect remotely to the database via any software I use.

I've checked the port is correct and skip-networking is off and bind-address is not set to local only. What else should I check?

share|improve this question
    
Can you telnet to the server on port 3306? –  growse Jun 26 '12 at 15:42

3 Answers 3

up vote 1 down vote accepted

If you have a user like root@'%', you should be able to connect. You should change this to root@'xx.xx.xx.%' instead of root@'%' as you do not want remote access that wide open.

You may need to check your firewall settings.

Try this

service iptables stop

then try connecting again

share|improve this answer
    
Thanks, it was the iptables settings. –  tamewhale Jun 26 '12 at 16:05
2  
Don't just leave iptables stopped. Write an iptables rule for the mysql traffic.. –  Tom O'Connor Jun 26 '12 at 16:49

Things to check:

  • Is MySQL running?
  • Did you run FLUSH PRIVILEGES; to ensure your grants updated?
  • Can the server access the outside world?
  • Does a local TCP connection work? mysql --host=127.0.0.1 --port=3306 -uroot -p
  • Is inbound port reachable via nmap or telnet?

Other than that, you will have to provide more information: The exact error you get when you try to access remotely from your MySQL client.

share|improve this answer

Your bind-address in my.cnf will probably be 127.0.0.1. This way it won't allow external access. Change this to your internet IP will solve this.

share|improve this answer

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.