I am trying for a couple of days now but I can't figure out how to connect via python to my MySQL database.
My plan is to connect from a website to the raspberry pi and control the wheels.
I am trying to control the speed of the wheels via a MySQL database.
The last thing I tried is:
(I have more things imported but this is the only thing for MySQL.
Code: Select all
conn = MySQLdb.connect(database="XX",host="XX",user="XX",password="XX")
cur = conn.cursor()
cur.execute("SELECT * FROM XX")
for row in cur.fetchall() :