Guest User

Untitled

a guest
Sep 6th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
  2.  
  3. try:
  4. connection = pymysql.Connect(host =self.host, port = 3306,user = self.user, password = self.password, db = self.db, charset ='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
  5. print('conneciton to the server is live')
  6. return connection
  7. except ConnectionError as ce:
  8. print(ce)
  9. else:
  10. print('Cold not connect to the server')
Add Comment
Please, Sign In to add comment