Using pymysql with pycharm

五迷三道 提交于 2019-12-24 19:17:00

问题


I am trying to run a project with db synchronized with pymysql. I have not been able to start for a week due to this error. Please help me

mysql runs fine


回答1:


Your connection code is written as pymysql.connect(host="locahost", user="root", password="xxxx") but pymysql.connect requires you to provide password with the named argument as "passwd". So if you change it to the following, it should work fine.

conn = pymysql.connect(host="localhost", user="root", passwd="xxx")

There seem to have discrepencies in the pymysql's github readme. In the example code, it says "password=", but in other source files, it says "passwd=" and I always been using "passwd" and it works fine.

Your error message also states that password is not given by using password: NO



来源:https://stackoverflow.com/questions/50096442/using-pymysql-with-pycharm

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