MySQL Notification Settings

This page documents settings for configuring a MYSQL service as a target for Bucket Notifications. See Publish Events to MySQL for a tutorial on using these settings.

You can establish or modify settings by defining:

  • an environment variable on the host system prior to starting or restarting the MinIO Server. Refer to your operating system’s documentation for how to define an environment variable.
  • a configuration setting using mc admin config set.

If you define both an environment variable and the similar configuration setting, MinIO uses the environment variable value.

Some settings have only an environment variable or a configuration setting, but not both.

Multiple MYSQL Targets

You can specify multiple MySQL service endpoints by appending a unique identifier _ID for each set of related MySQL settings on to the top level key.

Examples

The following commands set two distinct MySQL service endpoints as PRIMARY and SECONDARY respectively:

export MINIO_NOTIFY_MYSQL_ENABLE_PRIMARY="on"
export MINIO_NOTIFY_MYSQL_DSN_STRING_PRIMARY="username:password@tcp(mysql.example.com:3306)/miniodb"
export MINIO_NOTIFY_MYSQL_TABLE_PRIMARY="minioevents"
export MINIO_NOTIFY_MYSQL_FORMAT_PRIMARY="namespace"

export MINIO_NOTIFY_MYSQL_ENABLE_SECONDARY="on"
export MINIO_NOTIFY_MYSQL_DSN_STRING_SECONDARY="username:password@tcp(mysql.example.com:3306)/miniodb"
export MINIO_NOTIFY_MYSQL_TABLE_SECONDARY="minioevents"
export MINIO_NOTIFY_MYSQL_FORMAT_SECONDARY="namespace"

With these settings, MINIO_NOTIFY_MYSQL_ENABLE_PRIMARY indicates the environment variable is associated to a MySQL service endpoint with ID of PRIMARY.

mc admin config set notify_mysql:primary \
   dsn_string="username:password@tcp(mysql.example.com:3306)/miniodb"
   table="minioevents" \
   format="namespace" \
   [ARGUMENT=VALUE ...]

mc admin config set notify_mysql:secondary \
   dsn_string="username:password@tcp(mysql.example.com:3306)/miniodb"
   table="minioevents" \
   format="namespace" \
   [ARGUMENT=VALUE ...]

Settings

Enable

Required

MINIO_NOTIFY_MYSQL_ENABLE

envvar

Specify on to enable publishing bucket notifications to a MySQL service endpoint.

Defaults to off.

Requires specifying the following additional environment variables if set to on:

notify_mysql

mc-conf

The top-level configuration key for defining an MySQL service endpoint for use with MinIO bucket notifications.

Use mc admin config set to set or update an MySQL service endpoint. The following arguments are required for each target:

Specify additional optional arguments as a whitespace (" ")-delimited list.

mc admin config set notify_mysql \
  dsn_string="username:password@tcp(mysql.example.com:3306)/miniodb"
  table="minioevents" \
  format="namespace" \
  [ARGUMENT="VALUE"] ... \

Data Source Name (DSN) String

Required

MINIO_NOTIFY_MYSQL_DSN_STRING

envvar

notify_mysql dsn_string

mc-conf

Specify the data source name (DSN) of the MySQL service endpoint. MinIO expects the following format:

<user>:<password>@tcp(<host>:<port>)/<database>

For example:

"username:password@tcp(mysql.example.com:3306)/miniodb"

Table

Required

MINIO_NOTIFY_MYSQL_TABLE

envvar

notify_mysql table

mc-conf

Specify the name of the MySQL table to which MinIO publishes event notifications.

Format

Required

MINIO_NOTIFY_MYSQL_FORMAT

envvar

notify_mysql format

mc-conf

Specify the format of event data written to the MySQL service endpoint. MinIO supports the following values:

namespace

For each bucket event, MinIO creates a JSON document with the bucket and object name from the event as the document ID and the actual event as part of the document body. Additional updates to that object modify the existing table entry for that object. Similarly, deleting the object also deletes the corresponding table entry.

access

For each bucket event, MinIO creates a JSON document with the event details and appends it to the table with a MySQL-generated random ID. Additional updates to an object result in new index entries, and existing entries remain unmodified.

Max Open Connections

Optional

MINIO_NOTIFY_MYSQL_MAX_OPEN_CONNECTIONS

envvar

notify_mysql max_open_connections

mc-conf

Specify the maximum number of open connections to the MySQL database.

Defaults to 2.

Queue Directory

Optional

MINIO_NOTIFY_MYSQL_QUEUE_DIR

envvar

notify_mysql queue_dir

mc-conf

Specify the directory path to enable MinIO’s persistent event store for undelivered messages, such as /opt/minio/events.

MinIO stores undelivered events in the specified store while the MySQL server/broker is offline and replays the stored events when connectivity resumes.

Queue Limit

Optional

MINIO_NOTIFY_MYSQL_QUEUE_LIMIT

envvar

notify_mysql queue_limit

mc-conf

Specify the maximum limit for undelivered messages. Defaults to 100000.

Comment

Optional

MINIO_NOTIFY_MYSQL_COMMENT

envvar

notify_mysql comment

mc-conf

Specify a comment to associate with the MySQL configuration.

Last modified August 2, 2026: init commit (8338d5b)

Portions of this page are adapted from the MinIO Object Storage Documentation, © 2020–Present MinIO, Inc., licensed under CC BY 4.0, converted and maintained by the Silo project. Attribution