importError : no module named mysql.connector

importError : no module named mysql.connector
0.0 0

#1

Hi,
Thanks to itversity team for providing the platform to learn more !!

I am very new to python. Started learning from itversity.

I am trying to implement part of it in bigdata labs.

import mysql.connector, datetime
from mysql.connector import errorcode

cnx = mysql.connector.connect(user=retail_dba, password=itversity,
host=nn01.itversity.com,
database=retail_export)
cursor = cnx.cursor()
query = (“select * from customers limit 10”)
cursor.execute(query)
for i in cursor:
print(i)

Run the program using:
python /home/swapnabigdata85/python-code/mysqlPyth.py

Please help me!!

Thanks In Advance!!!