Connect to remote mysql via terminal

試著忘記壹切 提交于 2019-12-05 08:08:21

Try to comment the bind-address = 127.0.0.1 in your /etc/mysql/my.cnf

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

and watch the results. If not work try to use the IP address and if still not work. roll back the original file.

Verify that you can connect to the mysql port with telnet from that remote machine, e.g.

telnet 192.168.1.52 3306

If that fails, there's a firewall somewhere preventing you to connect, or you're running mysql on a different port than the default(3306) or mysql isn't configured to listen on the interface/ip address (maybe it's just configured to listen on connections from localhost, check the bind-address configuration in the my.cnf config file)

Can you telnet to the MySQL port 3306? If you can't then check to make sure the MySQL server service is listening on that port. Open a command prompt and type the following example. Example: telnet yourmysqlservername.com 3306

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!