haramq
haramq

Reputation: 161

Using pymysql with pycharm

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 enter image description here

mysql runs fine enter image description here

Upvotes: 0

Views: 699

Answers (1)

thuyein
thuyein

Reputation: 1792

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

Upvotes: 1

Related Questions