How can I connect to databse for access remote?

Posted October 21, 2013 21.8k 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.

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
Did you grant your MySQL user privileges to access the database on the public IP?
Hi Pablo,

I tried entering the following command but it gives me error

# mysql -u root -p

mysql> update db set Host=’‘ where db=’db_name‘;
ERROR 1046 (3D000): No database selected

think you are missing a step?

Where did you get that command from?

Did you add a user for connecting remotely? See

Replace localhost with where is your home IP address.
by Etel Sverdlov
MySQL is a powerful database management system used for organizing and retrieving data. This tutorial explains how to to create new MySQL users and how to grant them the appropriate permissions.
restart mysql on ubuntu: sudo service mysql restart

Hey CFRANCO80, did you find the way to connect remotely to your MySQL server using NaviCat? or somebody knows if this is possible?

Submit an Answer