Commit f765e11b authored by 任婷婷's avatar 任婷婷

.

parent c5716bb0
......@@ -218,6 +218,32 @@ def show_kafka_and_portrait():
def get_jerry_test():
# try:
db = pymysql.connect(host="172.16.40.170",
port=4000,
user="st_user",
passwd="aqpuBLYzEV7tML5RPsN1pntUzFy",
db="jerry_test",
charset="utf8")
print('connection stauts 1:',connect.open)
connect.close()
connect.ping(reconnect=True)
print('connection stauts 2:',connect.open)
return db, db.cursor()
# except Exception as e:
# print(e)
# return None
if __name__ == '__main__':
......
......@@ -362,6 +362,11 @@ def get_jerry_test():
passwd="aqpuBLYzEV7tML5RPsN1pntUzFy",
db="jerry_test",
charset="utf8")
print('connection stauts 1:', db.open)
db.close()
db.ping(reconnect=True)
print('connection stauts 2:', db.open)
return db, db.cursor()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment