> For the complete documentation index, see [llms.txt](https://docs.zmanda.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zmanda.com/guides/protected-items/mysql.md). Agents can also search and read this documentation through its [MCP server](https://docs.zmanda.com/~gitbook/mcp).

# MySQL

* **Logical backup:** Backs up MySQL databases at the logical (SQL) level, preserving data structure and relationships.
* **Compatible engines:** Works seamlessly with MySQL, [MariaDB](https://mariadb.org/), [Percona Server for MySQL](https://www.percona.com/software/mysql-database/percona-server), and [TiDB](https://pingcap.com/products/tidb).
* **Direct data transfer:** Avoids local disk spooling for efficient backups.
* **Streamlined backup process:**
  * Data is directly fed into Zmanda Pro's compression and encryption engine for processing.
  * Chunks are checked for duplication in storage.
  * New chunks are directly sent to the Storage Vault.
* **Individual database backups:** Each database is backed up separately, ensuring per-database point-in-time consistency.
* **Minimal progress indicators:** ETA and progress indicators are limited due to direct data transfer.

### Connection Details <a href="#connection-details" id="connection-details"></a>

{% hint style="info" %}

* Use TCP for connection (IP address and port required).
* Unix socket file connections are not currently supported.
* Configure SSL/TLS parameters for secure MySQL connections (21.9.7 and later).
  * Allow self-signed server SSL certificates or provide a server CA file/directory path.
  * Specify paths to a client SSL certificate (PEM file, typically .crt and .key extensions).
    {% endhint %}

### Selecting databases​ <a href="#selecting-databases" id="selecting-databases"></a>

* Use the **+** button to launch the database browser.
* Choose databases to back up.
* Add custom properties using the dropdown-plus button.

### Custom mysqldump​ <a href="#custom-mysqldump" id="custom-mysqldump"></a>

Zmanda Pro relies on `mysqldump` for logical (SQL) level backups.

Location priority:

1. **Custom Path:** If you've set a custom path to `mysqldump`, it will be used.
2. **Local Installation:** If `mysqldump` is installed on the device (e.g., backing up from the MySQL server itself), the local version is used for compatibility.
3. **Windows Bundle:** If not found elsewhere, Windows versions of Zmanda Pro include a recent `mysqldump` binary.
4. **Error:** If no suitable `mysqldump` is found, the backup fails with an error message indicating its absence. Check job status or logs for this message.

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​ <a href="#system-databases" id="system-databases"></a>

* **mysql:** Contains server configuration (accounts, grants). Restore only to the same MySQL major release.
* **information\_schema:** Read-only views, no need to restore.
* **performance\_schema:** Aggregated statistics, no need to restore.
* **sys:** (MySQL 5.7.7+) Performance statistics, safe to exclude if backup fails.

### Stored Procedures​ <a href="#stored-procedures" id="stored-procedures"></a>

Restore tables with stored procedures, but the login user needs SYSTEM\_USER and SET\_USER\_ID rights.

### Isolation Modes​ <a href="#isolation-modes" id="isolation-modes"></a>

Control consistency of data read from MySQL, depending on engine type.

Options:

| **Isolation Mode**      | **InnoDB**           | **MyISAM**           | **Detail**                                                                |
| ----------------------- | -------------------- | -------------------- | ------------------------------------------------------------------------- |
| Transaction             | Consistent           | Inconsistent         | Wrap read access in a single transaction.                                 |
| Lock tables *(default)* | Consistent, but slow | Consistent, but slow | Locks database access for consistency. Requires `LOCK TABLES` permission. |
| None                    | Inconsistent         | Inconsistent         | No transaction or table locking.                                          |

{% hint style="info" %}

* Choose isolation mode based on engine type and consistency requirements.
* Consider performance implications (Lock tables can be slower).
* Ensure necessary permissions for chosen isolation mode.
  {% endhint %}
