View Source

{note:title=Notice}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.
{note}

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.

{info:title=Note}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.
{info}
1. Select the "MySQL" tab in the Policy window. You can do this while [creating a new Policy|Create policies] as shown below.

!Create New Policy_MySQL tab_English.png!

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].

!Edit Policy_MySQL_English.png!

2. On the "MySQL" tab of the "Edit Policy" window, click on the "Add New MySQL Instance" button.

!Edit Policy_Add New MySQL Instance button_English.png!

3. The "Add Database Instance" wizard window will appear. Familiarize yourself with the introductory information, and click "Next" to proceed with adding the Instance.

!Add Database Instance_Introduction_English.png!

If you see the following error message, then the database driver is not installed on your Server.

!warn.png!

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.

!Add Database Instance_Name_English.png!

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.

{note:title=Notice}The "Use Alternate Host Name/IP" option is used in the following cases:
* Multiple network interfaces are configured on the host, each with a different IP address configured for connection. Example: {{eth1}}

_Or_
* When you have configured multiple IP addresses over the same network interface. Example: {{eth0:1}} (Aliasing).
The "Use Alternate Host Name/IP" option is *not* used to connect to another host.{note}

!Add Database Instance_Host_English.png!

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.
{info:title=Note}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.
{info}
* *Password* \- Enter the password of the above-mentioned user.
* *Confirm Password -* Re-enter *the same* password as you entered in the "Password" field.

!Add Database Instance_Authentication_English.png!

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}}.

{info:title=Note}Do not use the PVC Hardware Node’s path.{info}

  !Add Database Instance_Data Directory_English.png!

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.

  !Add Database Instance_Base Directory_English.png!

9. On the "Options" screen, you can "Specify a Virtuozzo Container ID" and "Get MySQL table statistics."
{info:title=Note}Receiving MySQL table statistics may slow down the replication process.
{info}

!Add Database Instance_Options_English.png!

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.

!Add Database Instance_Summary_English.png!

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.

!Create New Policy_MySQL instance added_English.png!

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.

!Create New Policy_Create button_2_English.png!

{info:title=Note}

{color:#000000}You can also click the "Create and run" button. In this case your Policy will be created and ran immediately.{color}


!Create New Policy_Create and run button_2_English.png!
{info}
{excerpt:hidden=true}Instructions on how to add a MySQL Instance to a policy in Server Backup Manager.{excerpt}