OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")
解决方案:
db = MySQLdb.connect(host="127.0.0.1",user="db_username",passwd="db_password",db="db_name")
这是因为在windows上面必须用127.0.0.1指向本地主机,如果用ubantu就没有问题。
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (10061)")
解决方案:
db = MySQLdb.connect(host="127.0.0.1",user="db_username",passwd="db_password",db="db_name")
这是因为在windows上面必须用127.0.0.1指向本地主机,如果用ubantu就没有问题。
转载于:https://my.oschina.net/jishuge/blog/649828