How can I connect to databse for access remote?

Posted October 21, 2013 22.5k views
Hi guys! I try to connect to my DB from navicat but is not possible. I installed LAMP as indicated in this guide ( ), but they refused me via remote access and do not know how to configure it to give permissions. how to allow remote access to mysql?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
15 answers
In the MySQL configuration file, change the bind-address = directive to your droplet's public IP address.
Thank you Pablo!

I treyed with this, but indicated the following:

In the file /etc/my.cnf
# Disabling symbolic-links is recommended to prevent assorted security risks
bind-address ###.###.###.## //IP of my Server Droplet


# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
MySQL Daemon failed to start.
Starting mysqld: [FAILED]

bind-address ###.###.###.## //IP of my Server Droplet
make that
bind-address = ###.###.###.## //IP of my Server Droplet
Hi guys!

I followed the steps you indicated and corrected the detail, but I still without being able to connect.

This is the message:

Connection Failed
Host '' is not allowed to connect to this MySQL server

Best regards!
Did you open MySQL's port in the firewall?
Hi Pablo,
as I can see this?
Hi Pablo!

This is my firewall

# iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
DROP tcp -- tcp flags:0x3F/0x00
DROP tcp -- tcp flags:!0x17/0x02 state NEW
DROP tcp -- tcp flags:0x3F/0x3F
ACCEPT all --
ACCEPT tcp -- tcp dpt:80
ACCEPT tcp -- tcp dpt:443
ACCEPT tcp -- tcp dpt:25
ACCEPT tcp -- tcp dpt:26
ACCEPT tcp -- tcp dpt:465
ACCEPT tcp -- tcp dpt:110
ACCEPT tcp -- tcp dpt:995
ACCEPT tcp -- tcp dpt:143
ACCEPT tcp -- tcp dpt:993
ACCEPT tcp -- tcp dpt:22
ACCEPT tcp -- tcp dpt:22
ACCEPT tcp -- tcp dpt:3306

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

see something strange?
Firewall looks okay. After you changed the bind-address, did you restart MySQL?

Also, instead of opening up the MySQL port to the entire world, are you able to limit it to a few IPs? The question is, how many remote hosts need to connect to MySQL? If (i) a few and (ii) they have static IPs, then you're best advised to limit MySQL access to those IPs, only.

Lastly, are the remote hosts trying to connect to MySQL also behind a firewall?
Hello Pablo,

Thank you very much for the help.

Restart MySQL?
Yes, yes I did.

How many remote hosts need to connect to MySQL?
I need to connect remotely from 2 teams mac os , one at home and one in my work.

the remote hosts are trying to connect to MySQL Also behind a firewall?
No, because I could connect to other servers without problem.

any other idea?

Best regards
Previous 1 2 Next