Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. try:
  2. cnx = mysql.connector.connect(user='root',
  3. password='root',
  4. database='BDhospital')
  5. except mysql.connector.Error as err:
  6. if err.errno == errorcode.ER_ACCESS_DENIED_ERROR:
  7. print("Something is wrong with your user name or password")
  8. elif err.errno == errorcode.ER_BAD_DB_ERROR:
  9. print("Database does not exist")
  10. else:
  11. print(err)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement