Syncrify can efficiently backup and restore a running instance of MySQL server. This page demonstrate how to configure the MySQL plugin in Syncrify. It also talks about some pre-requisites and other important information to keep in mind.
Backups to MySQL server is run in two steps:
Friendly name: | A name that identifies this backup entry. This name is used as part of the folder to store the backup on the server. Therefore, this name must conform to the rules used to specify file names. For example, you cannot have \ / : * ? " < > | characters. |
---|---|
SQL Server host: | This MUST be localhost. You cannot backup a MySQL server running on a different machine. |
TCP/IP Port: | Refers to the TCP/IP port where server is running. The default value is 3306. |
Login: | A valid user in MySQL server that has permission to backup |
Password: | User's password |
Database: | Database name in MySQL server. Although you can backup any database, including mysql and test, you cannot use Syncrify to automatically restore a mysql database. See below to see what is an automatic restore |
Temp file path: | This is the location where Syncrify creates a backup of the database on the local machine. |
Auto Restore | Unintentional restores in a database can be dangerous. This checkbox provides a safeguard against such intentional restores. When this box is not checked, a restore will only cause the .BAK and .SQL files to get downloaded from the remote Syncrify server to client. An actual database restore won't occur. A DBA can then manually restore the database from the .BAK if needed.
When this box is checked, besides restoring the .BAK file, Syncrify will run execute commands in schema.sql and restoreDB.sql file, which does the following:
|
Retain work files: | Backing up MySQL Server is a two-step process. First, Syncrify runs a SELECT * INTO OUTFILE command against MySQL Server. This creates a .BAK file on the client machine contain a backup. Syncrify then backs up this local file to the remote machine in the second step. When this option is checked, Syncrify won't delete the .BAK file that is created in the first step. If you have enough hard-disk space to hold this temporary files, we recommend you leave this option checked. |
Client to Server | This is the default backup direction. Syncrify create .BAK files, which are then transferred to the remote machine. |
---|---|
Server to Client | This is like a restore. Syncrify pulls the .BAK file from the server and if Auto Restore is checked, runs schema.sql and restoreDB.sql scripts against the database. |
Two-way sync | We discourage using two-way sync when using this plugin. Since a .BAK file is created on demand, Syncrify will always end-up pushing the local copy to the server. This can create unwanted results. |
When Auto Restore option is turned off, your must manually restore a database. This includes running SQL scripts in
You can use any querying tool to run these scripts. We recommend you use WinSQL.
Both script files (schema.sql and restoreDB.sql) contain several SQL statements. These statements are terminated by the word go on a line by itself. If you use a tool other than WinSQL, you will have to change this query terminator to a value that is understood by that tool.