In Server Backup, end-user-level MySQL backup is not supported. Only super-users can make a MySQL backup. Sub-users are limited by Server user permissions.
You need to allow Server Backup to see the MySQL database in the client. This can be done by entering information about the database in the Policy. Follow the instructions below in your Server Backup Enterprise or Advanced.
To add a MySQL Instance to your Server Backup, you will first need to install the MySQL database driver. See [Installing MySQL Connector JDBC into Server Backup] for detailed instructions.
1. Select the "MySQL" tab in the Policy window. You can do this while creating a new Policy as shown below.
You can also select the "MySQL" tab in the "Edit Policy" window after the Policy has been saved, and even while it is running. See Edit policies.
2. On the "MySQL" tab of the "Edit Policy" window, click on the "Add New MySQL Instance" button.
3. The "Add Database Instance" wizard window will appear. Familiarize yourself with the introductory information, and click "Next" to proceed with adding the Instance.
If you see the following error message, then the database driver is not installed on your Server.
See Install MySQL Connector JDBC into Server Backup for detailed instructions on how to install the driver.
4. On the following "Name" screen, you can define the name for your database and enable or disable the database Instance.
5. The next wizard screen is "Host." Here you can enter the information about the host to connect to. By default, the Server's current host name is used.
- Use Alternate Host Name/IP
- Host Name/IP - Specify the host name or IP address if it differs from the Server's current host name/IP address. When using MySQL on a Parallels Virtuozzo Containers (PVC) container, add the IP address of the MySQL container.
- Port Number - By default, the "3306" port number is used. If you use another port number to connect to the database in your environment, specify the port number in this field.
The "Use Alternate Host Name/IP" option is used in the following cases:
6. On the "Authentication" screen, you must specify the authentication credentials to connect to the database Instance.
- Username - Enter the name of a user who has full administrator-level access to the database Instance you want to back up.
You do not need to create a new user to allow remote connections to a MySQL Instance. While adding a MySQL Instance to the Policy, you can use the credentials of any MySQL user with full access to the MySQL server from localhost. For example, you can use the MySQL "root@localhost" account, which is typically created during MySQL server installation.
- Password - Enter the password of the above-mentioned user.
- Confirm Password - Re-enter the same password as you entered in the "Password" field.
7. On the "Data Directory" screen, you can optionally define the path of the data directory. By default, the application discovers where the database stores its data files. In some environments, the data directory is located under a different path than the discovered path. For these cases, you can specify the exact path to the database's data directory.
In order to properly restore the MySQL container, add the path of the MySQL container, e.g., /var/lib/mysql.
Do not use the PVC Hardware Node’s path.
8. On the next screen, specify a base directory to use (if it differs from the standard directory). By default, the system attempts to automatically determine where on the file system the necessary program files are located. In some environments, the automatic method fails. To remedy this, you can choose to specify the exact path for the base directory. This will ensure that the system can locate the necessary files.
9. On the "Options" screen, you can "Specify a Virtuozzo Container ID" and "Get MySQL table statistics."
Receiving MySQL table statistics may slow down the replication process.
To set up a MySQL database on a PVC container, you will need to specify the following:
- Host - "Use Alternate Host Name/IP" must be checked with the host name/IP address and port details added.
- Authentication - Username and password for the MySQL Instance.
- Options - "Specify a Virtuozzo Container ID" must be checked and the container ID added.
Read more in Add a MySQL instance to a policy on a PVC container.
10. On the last "Summary" screen, the settings you have selected are displayed.
Once you have verified that the specified settings are correct, click "Add" to add your MySQL Instance to the Policy.
11. The wizard screen closes, and the added MySQL Instance appears on the "MySQL" tab of the "Create New Policy" window. Instance options are displayed in the appropriate columns.
It is possible to apply the following actions to the MySQL Instance via the corresponding icons:
- Edit - Opens the "Add Database Instance" wizard where you can change the Instance settings.
- Delete - Removes the Instance without prompting you to confirm the removal.
- Test Connection - Attempts to connect to the database at the specified host and port using the provided authentication credentials. Optionally performs Flush and Lock check.
- Disable - Disables the MySQL Instance. A disabled Instance retains its configuration, but will not be backed up when the Policy executes.
13. Complete the MySQL Instance adding by clicking the "Create" button.
You can also click the "Create and run" button. In this case your Policy will be created and ran immediately.