Skip to content

Mysql

MySQL Configuration Requirements

If you are deploying Comet in a self-hosted environment, it is crucial to configure specific MySQL parameters to ensure optimal performance and functionality.

This applies regardless of where your MySQL instance is hosted—be it a self-managed server, AWS RDS, GCP Cloud SQL, or Azure Database for MySQL.

Note

If you utilize our provided Terraform module or cometctl, these parameters are automatically configured for you.

However, for externally configured MySQL instances, manual configuration is required.

Here are the mandatory MySQL parameters and their recommended values:

Parameter NameRecommended ValueDescription
character_set_serverutf8mb4Sets the server's default character set.
character_set_connectionutf8mb4Sets the character set for client-server communication.
character_set_databaseutf8mb4Sets the default character set for databases.
character_set_resultsutf8mb4Sets the character set for result sets sent to the client.
collation_connectionutf8mb4_unicode_ciSets the collation for client-server communication.
collation_serverutf8mb4_unicode_ciSets the server's default collation.
innodb_flush_log_at_trx_commit1Ensures logs are written and flushed to disk at transaction commit.
innodb_lock_wait_timeout120Specifies the time an InnoDB transaction waits for a row lock.
max_allowed_packet157286400 (approx. 150MB)Maximum size of one packet or any generated/intermediate string.
thread_stack2000000 (approx. 2MB)Sets the thread stack size for each thread.
group_concat_max_len1000000 (approx. 1MB)Maximum result length for the GROUP_CONCAT() function.
log_bin_trust_function_creators1Allows the creation of stored functions when binary logging is enabled.

Please ensure that these parameters are set correctly in your MySQL instance's configuration. Failure to do so may lead to suboptimal performance or unexpected behaviors in our application.

Feb. 9, 2024