

However, it looks from the netstat output as if mysql is still listening on localhost rather than on the public IP. > MySQL said: Can't connect to MySQL server on '139.161.234.123' (61)Īctive Internet connections (only servers) > Be sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds). I've also edited /etc/alternatives/my.cnf (which is symlinked to /etc/mysql/mysql.cnf) so it looks like this: I also have the following explicit UFW rules (where 81.123.67.94 is my laptop's current IP address) Temporarily changed the UFW firewall settings to "sudo ufw default allow incoming". I need to be able to connect using a standard connection (no SSH key-pair). However, this is using the 'SSH' option and key-pair authentication. Using Sequel Pro, I can already connect to _target_database_ using _target_user_. I've created a new database user (_target_user_) which has the correct privileges for _target_db_. I'm trying to make an existing MYSQL database (_target_db_) on this server available for remote connection by a separate, remote (trusted) PHP application. PS I'll also just list some settings I have in /etc/ssh/sshd_config, just in case they're relevant: PermitRootLogin noĪddressFamily inet # so that SSH daemon listens only on IPv4. To my mind, because I have i) UFW/firewall set to default allow incoming traffic and ii) I've configured the bind-address option in MySQL to the server's public IP, then the connection should work. Unix 2 STREAM LISTENING 2836458 /run/user/1000/systemd/private Unix 2 STREAM LISTENING 14228 /var/run/fail2ban/fail2ban.sock Unix 2 STREAM LISTENING 12686 /run/uuidd/request Unix 2 STREAM LISTENING 12683 /var/run/dbus/system_bus_socket Unix 2 STREAM LISTENING 8017 /run/systemd/journal/stdout Unix 2 STREAM LISTENING 2837069 /var/run/mysqld/mysqld.sock Unix 2 SEQPACKET LISTENING 8009 /run/udev/control Unix 2 STREAM LISTENING 8006 /run/systemd/fsck.progress Unix 2 STREAM LISTENING 14105 /var/run/sendmail/mta/smcontrol Unix 2 STREAM LISTENING 2127878 /run/systemd/private Proto RefCnt Flags Type State I-Node Path Proto Recv-Q Send-Q Local Address Foreign Address StateĪctive UNIX domain sockets (only servers) Which gave me the following output: Active Internet connections (only servers) > Unable to connect to host 139.161.234.123, or the request timed out.īe sure that the address is correct and that you have the necessary privileges, or try increasing the connection timeout (currently 10 seconds). When I try to connect via Sequel Pro, I get: # The files must end with '.cnf', otherwise they'll be ignored. # * IMPORTANT: Additional settings that can override those from this file! # -print-defaults to see which it would actually understand and use. # Run program with -help to get a list of available options and with # One can use all long options that the program supports. # - "~/.my.cnf" to set user-specific options. # - "/etc/mysql/my.cnf" to set global options, # The MySQL database server configuration file. I've also edited /etc/alternatives/my.cnf (which is symlinked to /etc/mysql/mysql.cnf) so it looks like this:.Temporarily changed the UFW firewall settings to "sudo ufw default allow incoming".

So far, I have taken the following steps: Using Sequel Pro, I can already connect to target database using targetuser. I've created a new database user ( target user) which has the correct privileges for targetdb. I'm trying to make an existing MYSQL database ( target_db) on this server available for remote connection by a separate, remote (trusted) PHP application. LAMP is successfully installed and we already have a production website working well. I have a Linode 1024 running Ubuntu 16.04 LTS.
