我正在使用 Wamp Server 的 MySQL。我必须通过在 httpd.conf 和 httpd-vhosts 中设置“侦听”来将端口从 80 更改为 8000。我可以通过浏览器(localhost:8000/...)访问 phpMyAdmin,但是当我尝试通过这样的程序连接时:
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 并取消注释行时skip-grant-tables
,它可以工作my.ini