import mysql.connector
mydb = mysql.connector.connect(
host="10.0.72.17",
user="admin",
passwd="1qaz!QAZ",
database="test"
)
mycursor = mydb.cursor()
sql = "INSERT INTO biage(kompaniis_saxeli) VALUES (%s)"
val = ('bane')
mycursor.execute(sql, val)
mycursor = mydb.cursor()
mydb.commit()
This is my python code , and i create column
kompaniis_saxeli varchar(225)
but when i try to run this code there is error
raise ValueError("Could not process parameters")
ValueError: Could not process parameters
('bane')is the same as'bane', thus you're providing a string. You need to provide a tuple as the argument, and if you have only one value to pass, you can useval = ('bane',)(note the comma after the first element).