1. Check the port restrictions:
netstat -an|grep 3306
If it shows:
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN ,
Open the /etc/mysql/my.cnf file, find bind-address = 127.0.0.1 and change it to bind-address = 0.0.0.0 or comment it out. If there is no bind-address, add directly: bind-address = 0.0.0.0.
use again
netstat -an|grep 3306
2. Turn on the firewall
Use the following to view firewall status:
ufw status
Turn on the firewall:
ufw enable
3. Authorize mysql to connect remotely:
grant all privileges on *.* to 'username'@'%' identified by 'your password';
My username and password here are both root. Refresh permissions with the following statement:
FLUSH PRIVILEGES;
4.Navicate connects to the database:
Open SSH settings,
Connection test: