Here is my code:
import mysql.connector
import datetime
import dateutil.parser
import soundfile as sf
mydb = mysql.connector.connect(
host="localhost",
user="py",
password="12345678",
database="mydatabase"
)
mycursor = mydb.cursor()
sql = "INSERT INTO customers (adress) VALUES (%s)"
val = ("Highway 21")
mycursor.execute(sql, val)
mydb.commit()
print(mycursor.rowcount, "record inserted.")
ProgrammingError Traceback (most recent call last) in
ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%s)' at line 1