From 2f8381a0c5ab58ce1b3c97fe9614bff84ade1b7a Mon Sep 17 00:00:00 2001 From: workpc Date: Thu, 19 Dec 2024 14:05:57 +0800 Subject: [PATCH] aupapitest --- auptest.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/auptest.py b/auptest.py index d697635..fe4fd88 100644 --- a/auptest.py +++ b/auptest.py @@ -36,14 +36,27 @@ CREATE TABLE pims_api_log ( import mysql.connector from datetime import datetime + +# host = 'rm-2zehj3r1n60ttz9x5.mysql.rds.aliyuncs.com' # 服务器访问使用 +# database = 'jingbo_test' # 服务器访问使用 +host = 'rm-2zehj3r1n60ttz9x5ko.mysql.rds.aliyuncs.com' # 北京访问使用 +database = 'jingbo_test' # 北京访问使用 + + + # 配置数据库连接信息,根据实际情况修改 config = { - "user": "your_username", - "password": "your_password", - "host": "your_host", - "database": "your_database" + "user": "jingbo", + "password": "shihua@123", + "host": host, + "database": "jingbo_test" } + + + + + def insert_api_log(request_time, request_ip, request_url, request_method, request_params, response_status_code, response_content, response_time): try: # 建立数据库连接