diff --git a/application/config/config.yaml b/application/config/config.yaml index 6e089b4d25f25c36ed4016573f3317b0d4ca4675..09a9fb78b4e7b927c5a08e717383d9b7a46a99f4 100644 --- a/application/config/config.yaml +++ b/application/config/config.yaml @@ -36,3 +36,11 @@ Scheduler: Start: 2023-11-12 10:04:00 End: 2099-11-11 16:00:00 Timezone: Asia/Shanghai + +ExtraDB: + Host: localhost + Port: 3306 + User: root + Password: localhost123 + DB: elp + Sql: select * from users; diff --git a/application/libs/helper/mysql.py b/application/libs/helper/mysql.py index fc0e39251b10ec1a97e9ecf111927bad65f3127c..00d731b1307ece49920602259993f0b6cde8bd27 100644 --- a/application/libs/helper/mysql.py +++ b/application/libs/helper/mysql.py @@ -40,14 +40,14 @@ class MySQLHelper: if self.conn: self.conn.close() if exc_type: - print(f"Error occurred: {exc_val}") + print(f'Error occurred: {exc_val}') def execute(self, sql: str) -> Optional[tuple]: """ Execute the SQL statement and retrieve the results """ if not self.conn: - print("No connection available.") + print('No connection available.') return None try: @@ -58,5 +58,5 @@ class MySQLHelper: return result except Exception as e: - print(f"Error executing SQL: {e}") + print(f'Error executing SQL: {e}') return None