Q:

Python connect Mysql

i want to use cmd python to connect mysql database, but it not working and show me the error. After several try, still can't figure out how to fix this problem
can someone help me?
thanks
 

A:

the 3d param is password. you set in code "root". check  the real pass.
or if you don't have a passwd try this:
conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='mysql')

or as like here or here or here

