reload_config
Reload MariaDB server configuration from environment variables and .env files to apply changes without restarting the server.
Instructions
Reload configuration from environment variables and .env file.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mariadb_mcp/server.py:157-179 (handler)The main handler function for the 'reload_config' tool. It closes the existing database connection, reloads the configuration from environment variables, updates the connection parameters, and resets the connection pool for the next operation.async def reload_config() -> str: """Reload configuration from environment variables and .env file.""" try: # Close existing connection pool await db_connection.close() # Reload configuration config_manager.reload() # Update connection parameters db_connection.host = config_manager.get('host') db_connection.port = config_manager.get('port') db_connection.user = config_manager.get('user') db_connection.password = config_manager.get('password') db_connection.database = config_manager.get('database') db_connection.pool = None # Reset pool to force reconnection logger.info("Configuration reloaded successfully") return "Configuration reloaded successfully. New connection will be established on next database operation." except Exception as e: logger.error(f"Error reloading configuration: {e}") return f"Error reloading configuration: {str(e)}"