Estoy intentando insertar un registro en una tabla llamada direccion_1 pero me da error en la linea 6 cursor.execute(sql, ("dato 1", "dato 2", "dato 3")) - indicandome lo siguiente:
pymysql.err.ProgrammingError: (1064, "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 ''direccion_1' ('categoria', 'nombre', 'direccion') VALUES('dato 1', 'dato 2', 'd' at line 1")
no logro detectar la falla el codigo es este:
import pymysql
connection = pymysql.connect(host='localhost',user='root',db='direcciones')
try:
with connection.cursor() as cursor:
sql = "INSERT INTO 'direccion_1' ('categoria', 'nombre', 'direccion') VALUES(%s, %s, %s) "
cursor.execute(sql, ("dato 1", "dato 2", "dato 3"))
connection.commit()
finally:
connection.close()
print("Feliz termino")