import mysql.connector
config = {
'user' : 'root',
'passwd' : ' ',
'host' : 'localhost',
'raise_on_warnings' : True,
'use_pure' : False,
}
cnx = mysql.connector.connect(**config)
cnx.close()
I used this code to check my mysql package that I installed using the installer provided by the mysql
I ran the file in terminal and the result was,
Traceback (most recent call last):
File "/Users/Krishna/Documents/check.py", line 1, in <module>
import mysql.connector
ImportError: No module named 'mysql'
Help is highly appreciated.