鍍金池/ 問答/Python  數(shù)據(jù)庫/ python3使用pymysql鏈接mysql數(shù)據(jù)庫報keyerror錯誤

python3使用pymysql鏈接mysql數(shù)據(jù)庫報keyerror錯誤

clipboard.png

回答
編輯回答
不將就
pymysql.connect(host='localhost',user='user',password='passwd',db='db',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor)

password參數(shù)名錯誤,請按照文檔來寫http://pymysql.readthedocs.io...

2017年1月11日 20:27