# Enable CONNECTION Event Logging in Audit Logs for Azure MySQL Servers

- Source: https://support.icompaas.com/support/solutions/articles/62000234788-enable-connection-event-logging-in-audit-logs-for-azure-mysql-servers
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Azure Database Services Benchmark v1.0.0](https://support.icompaas.com/support/solutions/62000112693) › [Azure Database Services Benchmark](https://support.icompaas.com/support/solutions/folders/62000169261)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

**Profile Applicability:**

-   **Level 2**  
    

**Description:**The audit\_log\_events parameter in MySQL defines the types of events that are logged in the audit logs. Setting it to include CONNECTION helps log items such as successful and failed connection attempts to the server. This log data is useful for identifying unauthorized access, troubleshooting, and improving security.

**Rationale:** Enabling the logging of CONNECTION events ensures that all connection attempts, both successful and failed, are logged. This helps in tracking user activities, identifying potential security incidents, and meeting audit requirements. It's crucial for forensic investigations and ongoing security monitoring.

Impact:

-   Pros:  
    
    -   Helps in identifying and troubleshooting connection issues.  
        
    -   Provides insight into failed login attempts, improving security monitoring.  
        
    -   Helps comply with security auditing requirements.  
        
-   Cons:  
    
    -   May incur additional storage costs due to the increased size of the logs.  
        
    -   High-traffic databases may generate large volumes of logs, which could impact performance if not managed properly.  
        

**Default Value:**

By default, audit\_log\_events is not set to include CONNECTION.

**Pre-requisites:**

Ensure that audit\_log\_enabled is set to ON in MySQL.  

**Remediation**

**Test Plan:**

**Using Azure Portal:**

1.  Log in to Azure Portal: [https://portal.azure.com](https://portal.azure.com/).  
    
2.  Navigate to Azure Database for MySQL Servers.  
    
3.  For each MySQL server, select the server.  
    
4.  Under Settings, select Server parameters.  
    
5.  Ensure the audit\_log\_events parameter includes CONNECTION.
    

**Using Azure CLI:**1\. Run the following command to verify the audit\_log\_events setting:

az mysql server show --resource-group <resource-group-name> --name <server-name> --query "properties.parameters.audit\_log\_events"

  

-   Ensure the output includes CONNECTION.  
    

**Implementation Plan:**

**Using Azure Portal:**

1.  Log in to Azure Portal.  
    
2.  Go to Azure Database for MySQL Servers.  
    
3.  Select the MySQL server.  
    
4.  Under Settings, click Server parameters.  
    
5.  Set audit\_log\_events to include CONNECTION and click Save.
    

**Using Azure CLI:**  
1\. To enable CONNECTION logging, use the following command:

az mysql server configuration set --resource-group <resource-group-name> --server-name <server-name> --name audit\_log\_events --value CONNECTION

  

**Backout Plan:**

**Using Azure Portal:**

1.  Go to Azure Database for MySQL Servers.  
    
2.  Select the server and navigate to Server parameters.  
    
3.  Remove CONNECTION from audit\_log\_events if necessary.
    

**Using Azure CLI:**1.  To remove CONNECTION from audit\_log\_events, run

az mysql server configuration set --resource-group <resource-group-name> --server-name <server-name> --name audit\_log\_events --value <previous-value>

**References:**

-   [Azure Database for MySQL - Configuring Audit Logs  
    ](https://docs.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-audit-logs-portal)
    
-   [Azure MySQL Audit Log Events  
      
    ](https://docs.microsoft.com/en-us/azure/mysql/single-server/how-to-configure-audit-logs-cli)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
