Jul-31-2022, 10:22 AM
I have a problem on my raspberry with mysql (mariadb). When I execute this simple programm it shows this error. The database is made in phpmyadmin (generated password : HV8AoxbZ2H44uNgX).
import mysql.connector try: db = mysql.connector.connect(host = "localhost", database = "dobot", user = "dobot", password = "HV8AoxbZ2H44uNgX") if db.is_connected(): print("Connected to MySQL database.") #return db except mysql.connector.Error as e: print ("Error while connecting to MySQL", e)
Error:pi@raspberrypi:~/FTP/files/demo-magician-python-64-master $ python database.py
Error while connecting to MySQL Character set 'utf8' unsupported
Whats is wrong with my settings?