This might be a simple one, but I couldn't figure it out. I couldn't connect to the database that I created 'clearview' in mysql through.
Please advise. Thanks!
NameError                                 Traceback (most recent call last)
 in 
      3 try:
----> 4     connection = mysql.connector.connect(host='localhost',
      5                                          database='clearview',
NameError: name 'mysql' is not defined
Which version of python you are using???
a)first check you have import mysql.connector. If it is there and not working then can follow following steps.
b) It may be that mysql is not properly installed .Check via pip search mysql-connector | grep --color mysql-connector-python .
c) Install via : pip install mysql-connector-python-rf
Hope it will help.
how to connect using python to mysql server