Using the LEMP Marketplace image, what's the step by step way of allowing MySQL access from remote connections?

March 8, 2019 1.8k views
MySQL LEMP

Using the LEMP Marketplace image, what’s the step by step way of allowing MySQL access from remote connections?

4 Answers

Hey friend!

Great question. These steps should do it.

Setting MySQL to allow remote connections:

sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/mysql.conf.d/mysqld.cnf
systemctl restart mysql

Creating a remote user:

mysql
create user 'username'@'ipaddress' identified by 'password';
quit

Jarland

Hi Jarland,

That series of commands to create a user don’t quite work…

ERROR 1396 (HY000): Operation CREATE USER failed for ‘username’@'ipaddress’

  • Apologies, I should have specified. Replace these values in that:

    username: Replace with the username you want to log in with
    ipaddress: Replace with the IP address of the system you will be connecting from
    password: Replace with the password you will use to authenticate

PS I started by simply creating from an image and then logging in, no other steps.

Giving this up now. I’m clearly missing something obvious. SequelPro still throwing an error having completed those steps on a brand new droplet. Thanks for your help though :)

Have another answer? Share your knowledge.