Question

Cannot connect to MySQL database remotely

I provisioned this MySQL droplet: https://marketplace.digitalocean.com/apps/mysql

I am able to administer MySQL if I SSH via terminal, or if I go to http://my-ip-address/phpmyadmin

But I need to connect to my DB remotely. Whether I try to connect via terminal, or something like Sequel PRO, the connection fails with this error:

Host 'xxx.xxx.xxx' is not allowed to connect to this MySQL server

I followed every step of this guide (including setting bind-address to 0.0.0.0), but nothing changes and I’m still unable to connect: https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql

Any ideas?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @geochanto,

Have you created a new user that will only connect from the remote host? If not suggest you create a new user and try again.

You can get your local machine IP: https://whatismyipaddress.com/

CREATE USER 'sammy'@'remote_IP' IDENTIFIED BY 'password';

ALTER USER 'sammy'@'remote_IP' IDENTIFIED WITH mysql_native_password BY 'password';

GRANT CREATE, ALTER, DROP, INSERT, UPDATE, DELETE, SELECT, REFERENCES, RELOAD on *.* TO 'sammy'@'remote_IP' WITH GRANT OPTION;

FLUSH PRIVILEGES;

Regards, Rajkishore