MySQL
This Protected Item type backs up a MySQL database. It is also compatible with MySQL-compatible servers such as MariaDB, Percona Server for MySQL, and TiDB. It works at the logical (SQL) level.
No data is spooled to the local disk. As per the "Program Output" type, no progress bar or ETA appears during a MySQL backup. The data is fed directly into the Comet compression and encryption 'chunking' engine. There is a quick cryptographic hash-check to determine whether these chunks are duplicated in the storage location, and then any new chunks are sent directly to the Storage Vault.
Databases are backed up one-at-a-time. Point-in-time consistency is only preserved on a per-database basis.
Connection details
Connection details should be supplied before selecting databases. Fill in the fields on the Authentication tab to connect to your MySQL server.
Comet always connects to the MySQL server over TCP, using an IP address and port. Using a Unix socket file is not currently supported.
As of Comet 21.9.7, Comet supports configuring SSL / TLS parameters to secure the MySQL TCP connection.
- You can configure whether to allow self-signed server SSL certificates, or supply a path to a server CA file or directory.
- You can configure paths to a client SSL certificate. The client certificate should be in PEM (x.509) file format, usually with the
.crt
and.key
file extensions.
Selecting databases
Use the plus button on the right to open a database browser, allowing you to select individual databases for backup. Use the dropdown-plus button to add a custom property.
Custom mysqldump
Comet Backup's MySQL support works at the logical (SQL) level using mysqldump
. A copy of this program must be found on the device in order for the backup job to run.
The mysqldump
binary is selected as follows:
- If a custom path to
mysqldump
has been set, this binary is used. - Otherwise, if there is a version of
mysqldump
installed (e.g. you are backing up a MySQL server from the server itself), the local version ofmysqldump
will be used to ensure maximum compatibility. - Otherwise, if no copy of
mysqldump
can be found, the Windows version of Comet Backup bundles a recentmysqldump
binary in compliance with its license. - If no suitable
mysqldump
binary is found, the MySQL backup job will fail with an error messageCouldn't find 'mysqldump' anywhere
. This failure can be detected via the backup job's status or its log entries.
On Linux, you can install a copy of mysqldump
as follows:
Distribution | Command |
---|---|
Debian, Ubuntu | apt-get install mysql-client |
CentOS, RHEL | yum install mysql |
System databases
Comet supports backing up the built-in system databases if desired.
- The
mysql
database contains server configuration, including user accounts and grants. It should only be restored to the same major release of MySQL. - The
information_schema
database is a set of read-only views and does not need to be restored. - The
performance_schema
database is a set of aggregated statistics and does not need to be restored. - The
sys
database (in MySQL 5.7.7 and higher) is a set of performance statistics and does not need to be restored. If your version of MySQL does not successfully back up this table, it is safe to exclude it from the Comet Backup settings.
Stored Procedures
Tables which contain stored procedures can be restored, but be aware that the login user must have SYSTEM_USER and SET_USER_ID privileges.
Isolation modes
Comet allows you to select the isolation mode used when reading data from MySQL. You should select the most appropriate isolation mode for your MySQL engine type.
The following options are available:
Isolation Mode | InnoDB | MyISAM | Detail |
---|---|---|---|
Transaction | Consistent | Inconsistent | Wrap all read access in a single transaction, so that the read data is consistent |
Lock tables (default) | Consistent, but slow | Consistent, but slow | Lock access to database before reading it, so that the read data is consistent. This requires that the MySQL user account has been granted the LOCK TABLES permission |
None | Inconsistent | Inconsistent | Do not take a transaction and do not lock tables. |