Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. try:
  2. cnn = mysql.connector.connect(
  3. host="localhost:", # your host, usually localhost
  4. user="root", # your username
  5. password="root", # your password
  6. database="bb_cards") # name of the data base
  7. print("It Works!!")
  8. except mysql.connector.Error as e:
  9. if e.errno == errorcode.ER_ACCESS_DENIED_ERROR:
  10. print("Something is wrong with username or Password")
  11. elif e.errno == errorcode.ER_BAD_DB_ERROR:
  12. print("Database Does not exist")
  13. else:
  14. print(e)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement