Sign in Start free trial
← Help centre

How to configure MySQL or MariaDB database protection

Configure Safenix to protect a MySQL or MariaDB database with continuous capture or periodic full copies.

MySQL and MariaDB databases must be configured separately in Safenix. Copying the database files does not produce a restorable backup: the files may be read over several minutes while the database continues writing.

Safenix provides two protection modes. Continuous capture records each change as it occurs and lets you return to any point in time. It requires binary logging to be enabled on the server. Safenix cannot enable binary logging for you.

Periodic copies create a complete copy of the database at regular intervals. You can restore to the time of one of these copies, but not to an arbitrary point in time. This mode works even when binary logging is unavailable, which is common with shared hosting.

Configure database protection

  1. In the dashboard, open Servers and select “This server has a MySQL or MariaDB database”.

  2. Enter the database user that Safenix will use, the database address, and a replication identifier. The proposed values are suitable in most cases.

  3. Run the first command shown on the server. It checks the database and reports what is missing. The check reports whether binary logging is enabled, identifies any required permissions, and prints the exact SQL instructions needed to create them.

  4. Choose the protection mode in the dashboard:

    • Choose continuous capture if binary logging is enabled.
    • Choose periodic copies if the check reports that binary logging is disabled or if you do not know its status.
  5. Resolve every other problem reported by the check before continuing, such as a missing permission. Any unresolved problem would prevent the backup in either mode.

  6. Run the second command shown on the server. It asks for the database password in the terminal.

Choose which databases to include

You can leave Databases to include empty. Safenix then copies all databases visible to the configured user, and a database created later is automatically included in the next copy.

If you enter database names, all other databases are excluded.

Database permissions

The user Safenix uses for backups has read-only permissions. Applying a restore requires different and broader permissions, using a separate user. It is recommended to create that user only when it is actually needed.

Check that protection is working

In the server list, check the Database column. It shows the database size and the time of the latest complete copy.

Still stuck?

If this page did not solve it, write to us and a person answers.

Contact