Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
- try:
- connection = pymysql.Connect(host =self.host, port = 3306,user = self.user, password = self.password, db = self.db, charset ='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
- print('conneciton to the server is live')
- return connection
- except ConnectionError as ce:
- print(ce)
- else:
- print('Cold not connect to the server')
Add Comment
Please, Sign In to add comment