MySQL refuses to accept remote connections
Solution 1:
Try to add bind-address = 0.0.0.0
to your [mysqld]
section of your my.cnf
and restart mysqld.
Solution 2:
I just had this issue and my issue seemed to be firewall related. BTW - Thanks @Temnovit for the Mysql troubleshooting commands.
I used netstat to tell the server was running and on the correct port. I could also tell my server wasn't accepting connections on that port with a simple telnet command.
# On the remote machine
➜ ~ echo X | telnet -e X 192.168.1.57 3306
Telnet escape character is 'X'.
Trying 192.168.1.57...
telnet: connect to address 192.168.1.57: Connection refused
➜ ~
Following another helpful answer on Fedora firewall commands I could open the correct ports.
# On the server
sudo firewall-cmd --permanent --add-port=3306/tcp
sudo firewall-cmd --reload
My telnet command was then successful.
# On the remote machine
➜ ~ echo X | telnet -e X 192.168.1.57 3306
Telnet escape character is 'X'.
Trying 192.168.1.57...
Connected to 192.168.1.57.
Escape character is 'X'.
telnet> Connection closed.
➜ ~
If you still have problems, it's likely a user permissions issue.