Connecting to remote mysql via terminal

For the test, I configured the user user mysql with access%. When I try to connect from a remote machine, I get:

Enter password:

Then we immediately get the following:

ERROR 2003 (HY000): Cannot connect to MySQL server on 'xxxxxxx (1)

Any ideas

+6
mysql connection
source share
3 answers

Try commenting on bind-address = 127.0.0.1 in /etc/mysql/my.cnf

 # security: # using "localhost" in connects uses sockets by default # skip-networking # bind-address = 127.0.0.1 --- commented 

and see the results. If it doesn’t work, try using the IP address and if it doesn’t work yet. rollback of the source file.

+3
source share

Make sure you can connect to mysql port with telnet from this remote computer, for example

 telnet 192.168.1.52 3306 

If this fails, there is somewhere a firewall blocking the connection, or you are using mysql on a different port than the default (3306), or mysql is not configured to listen on the interface / IP address (maybe it's just configured to listen on connections from localhost, check bind-address configuration in my.cnf configuration file)

+12
source share

Can you telnet connect to MySQL port 3306? If you cannot verify that the MySQL server service is listening on this port. Open a command prompt and enter the following example. Example: telnet yourmysqlservername.com 3306

+2
source share

All Articles