In CDP, end-user-level MySQL backup is not supported. Only super-users can make a MySQL backup. Sub-users are limited by Agent user permissions.
If you have the Databases Add-On enabled for an Agent, you need to allow the CDP Server 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 CDP Enterprise or Advanced Edition.
To add a MySQL Instance to your Agent, you will first need to install the MySQL database driver. Go here 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 Editing 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 Agent.
See this chapter 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 Agent'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 Agent'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
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 Adding 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 Connections - 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. Save the Policy.