Remote MySQL on One-Click LAMP

Hello all,

I set up a LAMP server using the One-Click LAMP application (https://www.vultr.com/docs/one-click-lamp), I successfully SSH'd into the server, and I'm able to run the mysql commands.

However, I can't seem to setup remote-access, it always allows internally connections only.


For example:

I run this command: netstat -plant|grep ":3306"|grep "LISTEN"

and it shows me it's only listening to 127.0.0.1:

tcp    0   0 127.0.0.1:3306     0.0.0.0:*        LISTEN   4179/mysqld


I have tried adding bind-address=0.0.0.0 to the following three locations:

/etc/my.cnf, /etc/mysql/my.cnf, ~/.my.cnf

and I obviously restart mysql service each time (service mysql restart), however, I always receive a time-out connection when I attempt remote access.

And just for good measure, I re-run netstat -plant|grep ":3306"|grep "LISTEN" and it's still reporting 127.0.0.1


Does anybody have any idea?

Thank you

Comments

  • I tested and this worked for me. Here are my steps:

    • I deployed a One-Click LAMP.
    • I verified mysqld is listening on 127.0.0.1:3306.
    # netstat -uplnt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1236/mysqld
    
    • I edited this line in /etc/mysql/mysql.conf.d/mysqld.cnf

    bind-address = 0.0.0.0

    • I restarted mysqld:

    sudo systemctl restart mysql

    • I verified mysqld is listening on 0.0.0.0:3306
    # netstat -uplnt
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      2789/mysqld
    


This discussion has been closed.