Insert Data in mysql using python

  mysql, mysql-connector, mysql-python, python, python-3.x
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

Source: Python-3x Questions

LEAVE A COMMENT