How to connect remote access on MySQL Server via MySQL Workbench?

October 24, 2019 109 views
DigitalOcean Managed MySQL Database

Hi folks. I’m with problems to connect remote access in MySQL server using my MySQL Workbench. I’m using Ubuntu 14.04. When I try to connect receive this message: “Host xxx is not allowed to connect to this MySQL Server’, but I made the configurations in the mysqld.cnf where I changed bind-address from 127.0.0.1 to 0.0.0.0.

I need connect in this to follow with my projects.

Any suggests?

Thanks..

Miguel

1 Answer

Hello,

You need to make sure that the user that you are using is allowed to connect to the database in question from your IP address. You could check that by accessing MySQL and running:

SELECT user,host FROM mysql.user;

You should see something like this:

+------------------+-----------+
| user             | host      |
+------------------+-----------+
| youruser         | localhost |
| mysql.session    | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+

If you do not have your IP in the host section or a % sign then this means that your user can not access MySQL remotely. You could grant privileges for the user in question to for a sepcific host with the following command:

GRANT ALL ON YOUR_DB.* to YOUR_USER@'YOUR_IP' IDENTIFIED BY 'YOUR_PASS';

FLUSH PRIVILEGES;

Or if you would like to allow the user to access the DB in question from any remote IP, you could change the YOUR_IP with a % sign.

Let me know how it goes!
Regards,
Bobby

Have another answer? Share your knowledge.