Home › Documentation › Agents › MySQL and MariaDB
MySQL and MariaDB
Applies to MySQL 8.0 and 8.4, and MariaDB 10.6, 10.11 and 11.4, on Linux and Windows. Requires the Server plan.
How it works
The agent runs mysqldump (or mariadb-dump) with --single-transaction for each selected database and streams the output directly to the service. InnoDB tables are backed up consistently without locking. MyISAM and other non-transactional tables are locked for the duration of their dump.
Enable
Create a dedicated account:
CREATE USER 'cbk'@'localhost' IDENTIFIED BY '...';
GRANT SELECT, SHOW VIEW, TRIGGER, EVENT, LOCK TABLES, RELOAD, PROCESS, REPLICATION CLIENT ON *.* TO 'cbk'@'localhost';
Then:
sudo cbk config set mysql.enabled true
sudo cbk mysql credentials --user cbk
sudo cbk mysql select --all
Binary logs
For point-in-time restore, enable binary logging on the server and set:
sudo cbk config set mysql.binlog true
The agent then uploads completed binary log files every 15 minutes. Do not set binlog_expire_logs_seconds below one day, or logs may be purged before they are uploaded.
Large databases
Logical dumps become slow to restore above roughly 100 GB. For larger databases, consider taking physical backups with the vendor's own tool to a local directory and including that directory as a file-level source. We do not currently integrate with physical backup tools directly.
Restoring
See Database restore.
Exclusions
Exclude the MySQL data directory from file-level sources on the same server.