mysql remote access

Posted August 7, 2016 58.1k views
MySQLDigitalOceanUbuntu 16.04


I am trying to acces a MySql server from another one with no results.

I configured MySql to accept connections remotely. Open firewall at 3306…

Inserted new DB remote users, checked their passwords…

And no results yet.

Any idea ?

Thanks in advance.

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
5 answers

Please follow the steps in the link below to get remote access to MySQL -

  • please note that if you are as stupid as me (or just woke up) and blindly follow the guide and edit /etc/mysql/mysql.conf/mysql.cnf , you will write bind-address = your external ip right below skip-external-locking. And you will fail to see that it is redefined, fewer lines down, to bind-address =

Hi, maybe is late … but if you are running your mysql in mysql secure installation you have to :

  • create a user with related privileges on schema/tables you want and set limit hosting access to the IP you are connecting from (this means that the user can access only from that IP)

  • comment in the file /etc/mysql/mysql.conf/mysql.cnf (this is the configuration file used by mysql secure installation) the following line:

  • restart mysql sudo service mysql restart

  • add to your mysql server firewall the following rule:
    sudo ufw allow from IP_FROM_YOU_CONNECT to any port 3306

  • test from your remote location with

if everything is ok you will prompt for the user password and you will get to mysql shell

Tested on UBUNTU 16.04 and mySQL 5.7

I found that changing the bind-address in the /etc/mysql/mysql.cnf the bind-address is ignored. You can check with mySQL Workbench under System Variables (search for bind keyword)

I hope this helps.

Elizine sent a very good link.

It was a my.cnf bad configuration combined with a firewall problem. I could finally solve it.

Thanks a lot to eveybody !

Please post the following section of your mysql config:

bind-address = 

Also please post the output of the following mysql command:

SELECT User, Host FROM mysql.user WHERE Host <> 'localhost';

Which user are you trying to grant remote access? Also please post any error you get.

MySQL firewall provide by Datasunrise work as an intermediary between users and database. That fitlers each incoming and outgoing traffic.

For more information please visit here:-