MySQL Backup
You can use Veeam Agent for Linux to create transactionally consistent backups of Veeam Agent machines that run the MySQL database system.
Requirements and Limitations of MySQL Processing
- Veeam Agent for Linux supports processing of MySQL database systems version 5.7 – 9.7.
- Configurations with multiple MySQL installations or instances on the same machine are not supported.
- MySQL Cluster versions are not supported.
- Veeam Agent locks all MySQL tables that use storage engines other than InnoDB, for example MyISAM, MEMORY, ARCHIVE or CSV, while it creates the system snapshot. InnoDB tables are transactional and are captured consistently by the snapshot. Veeam Agent does not lock InnoDB tables by default.
To detect and lock non-InnoDB tables, the MySQL account used by Veeam Agent must have the following privileges:
SELECT— Required to read table metadata and detect non-InnoDB tables. Grant this privilege on every database that contains such tables. If the account lacksSELECTon a database, Veeam Agent cannot detect or lock its non-InnoDB tables. Processing completes successfully, but these tables may be captured in an inconsistent state.LOCK TABLES— Required to lock detected non-InnoDB tables. Grant this privilege on every database that contains such tables. If the account can detect a table but cannot lock it, MySQL database system processing fails. If successful application processing is not required, processing completes with a warning and the tables remain unlocked.FLUSH_TABLESorRELOAD— Required to run theFLUSH TABLES ... WITH READ LOCKstatement. This privilege must be granted instance-wide,ON *.*. If non-InnoDB tables are detected but the account has neither privilege, locking fails and MySQL database system processing fails. If successful application processing is not required, processing completes with a warning and the tables remain unlocked.FLUSH_TABLESis available in MySQL 8.0.23 and later. For earlier MySQL versions and MariaDB, useRELOAD.
To obtain information about the privileges that are assigned to an account, use MySQL functionality — for example, the SHOW GRANTS statement. To learn more, see MySQL documentation.
Authentication Methods
Veeam Agent for Linux can connect to the MySQL database system using one of the following methods:
- Password — Veeam Agent uses the MySQL account credentials that you specify in the backup job settings.
- Password file — Veeam Agent uses the MySQL account credentials that are stored in the
.my.cnfpassword file. To learn more about password file configuration, see Preparing Password File for MySQL Processing.
How MySQL Processing Works
To ensure that the backed-up data is in the consistent state, Veeam Agent for Linux performs the MySQL database system processing. To process the database system, Veeam Agent performs the following operations:
- When the backup job starts, Veeam Agent connects to the MySQL database system and obtains the list of tables.
- Veeam Agent locks the base tables that use storage engines other than InnoDB, such as MyISAM. Veeam Agent changes the table state using the MySQL functionality. Tables that use the InnoDB storage engine do not require locking.
- Veeam Agent creates a snapshot of the volume.
- Veeam Agent unlocks tables locked at Step 2.
After Veeam Agent unlocks tables, Veeam Agent proceeds to the next step of the backup process. To learn more, see How Backup Works.
Related Tasks