Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import mysql.connector
  2. from mysql.connector import Error
  3. from mysql.connector import errorcode
  4.  
  5. try:
  6. connection = mysql.connector.connect(host='localhost',
  7. database='sakila',
  8. user='root',
  9. password='Brownie2')
  10. mySql_insert_query = """INSERT INTO actor (actor_id,first_name,last_name,last_update)
  11. VALUES
  12. ('202','Harry','Potter','2019-11-20 14:00:00') """
  13.  
  14. cursor = connection.cursor()
  15. result = cursor.execute(mySql_insert_query)
  16. connection.commit()
  17. cursor.close()
  18.  
  19.  
  20. ERROR:
  21.  
  22. File "<ipython-input-5-1dccea6b009e>", line 18
  23.  
  24. ^
  25. SyntaxError: unexpected EOF while parsing
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement