0

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

Druta Ruslan
  • 7,171
  • 2
  • 28
  • 38
Die-Yi Su
  • 25
  • 1
  • 8
  • 1
    Possible duplicate of [Access denied for user 'root@localhost' (using password:NO)](https://stackoverflow.com/questions/2995054/access-denied-for-user-rootlocalhost-using-passwordno) – Druta Ruslan Jun 18 '18 at 09:31
  • For starters: edit your post and replace screenshot with text and format as code (look at tools panel). Next: prove that you are sure that mysql database alive and kicking: connectable by other clients – Alex Yu Jun 18 '18 at 09:33
  • sry , this is my first time to use this platform to ask question. thanks your suggest, i will try on next time ! – Die-Yi Su Jun 18 '18 at 09:46

1 Answers1

0

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