Answers for "connect to mysql workbench python"

SQL
0

connect to mysql workbench python

Press CTRL+C to copy import mysql.connector
from mysql.connector import errorcode

try:
  cnx = mysql.connector.connect(user='scott',
                                database='employ')
except mysql.connector.Error as err:
  if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
    print("Something is wrong with your user name or password")
  elif err.errno == errorcode.ER_BAD_DB_ERROR:
    print("Database does not exist")
  else:
    print(err)
else:
  cnx.close()
Posted by: Guest on July-20-2021

Code answers related to "connect to mysql workbench python"

Code answers related to "SQL"

Browse Popular Code Answers by Language