I add python as data source to redash but when import mysql.connector module get error
def read_sql():
import mysql.connector
mydb = mysql.connector.connect(
host=“localhost”,
user=“root”,
passwd=“123speakol”,
database=“testing”)
mycursor = mydb.cursor()
mycursor.execute(“select hour,sum(temperature) as temperature ,sum(wind_speed) as wind_speed from weatherdaat group by hour”)
myresult = mycursor.fetchall()
for x in myresult:
print(x[0],x[1],x[2])
read_sql()
Error running query: <type ‘exceptions.AttributeError’> ‘module’ object has no attribute 'connector’