我使用的是Wamp服务器的MySQL。我必须通过在httpd.conf和httpd-vhosts中设置"Listens“将端口从80更改为8000。我可以通过浏览器访问phpMyAdmin (本地主机:8000/...)但是当我尝试通过这样的程序连接时:
dbConn = MySQLdb.connect(host='192.168.1.110',port=8000, user='root', passwd='', db='test')它冻结了,整整60秒后,我得到了错误:
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 0")在端口更改之前,它工作得很好。
我该怎么办?提前感谢
编辑:当我将端口更改为3306并在my.ini中取消对行skip-grant-tables的注释时,它可以正常工作
发布于 2018-09-04 02:12:41
我想你改变了phpMyadmin的端口,但是你没有改变mysql的默认端口(3306)。
查看此处How to change the default port of mysql from 3306 to 3360
https://stackoverflow.com/questions/52154164
复制相似问题