View Source

To set up a MySQL database on a Parallels Virtuozzo Containers (PVC) container, you must specify the following:
* *Host* \- Select the *Use Alternate Host Name/IP* check box and enter the hostname/IP address and port details in the corresponding fields.
* *Authentication* \- Enter the username and password for the MySQL Instance.
* *Options* \- Select the *Specify a Virtuozzo Container ID* check box and enter the container ID in the corresponding field.

Follow the instructions below to add a MySQL Instance to a PVC container on your Server Backup policy.

{info:title=Note}


You can also find a detailed description of the _Add Database Instance_ window in [Adding a MySQL Instance to a Policy|Add a MySQL instance to a policy].
{info}



1. When [creating a new policy|ServerBackupManager:Create policies], select the _MySQL_ tab in the _Create New Policy_ window.

!Create New Policy - MySQL.png|border=1!

You can also add a MySQL instance after the policy has been added, and even while it is running. Select the _MySQL_ tab in the _Edit Policy_ window. For more information, see [Edit policies].

2. In the MySQL tab, click the *Add New MySQL Instance* button. The _Add Database Instance_ window displays, where you can add the MySQL instance.

3. In the _Introduction_ section of the _Add Database Instance_ window, review the introductory information and click *Next* to proceed.

!Add Database Instance 1.png|border=1!

{info:title=Note}
If you see the following error message, the database driver is not installed on your machine.

!MySQL database driver not found.png|border=1!

See [Install MySQL Connector JDBC into Server Backup] for detailed instructions on how to install the driver.
{info}

4. In the _Name_ section, define the name for your database and enable or disable the database instance. This name will display in the policy's _MySQL_ tab.

!Add Database Instance 2.png|border=1!


Click *Next* to continue.

5. In the _Host_ section, enter the information about the host to which you need to connect. Select the *Use Alternate Host Name/IP* check box and enter the IP address of the MySQL PVC container in the *Host Name/IP* field.

!Add Database Instance - Host PVC.png|border=1!

Click *Next* to continue.

6. In the _Authentication_ section, you must specify the authentication credentials to connect to the database instance.

!Add Database Instance 4.png|border=1!


Click *Next* to continue.



7. In the _Data Directory_ section, define the path of the data directory. In order to properly restore the MySQL container, add the path of the MySQL container. In our case, it is {{/var/lib/mysql}}.


Select the *Specify a Data Directory to Use* check box and enter the path in the *Data Directory* field.

{info:title=Note}
Do *not* provide the full path of the Hardware Node.{info}
!Add Database Instance - Data Directory PVC.png|border=1!


Click *Next* to continue. 



8. In the _Base Directory_ section, specify a base directory to use if it differs from the standard directory or if the automatic method fails.

!Add Database Instance 6.png|border=1!

Click *Next* to continue.


9. In the _Options_ section, select the *Specify a Virtuozzo Container ID* check box and enter the container ID in the corresponding field.

!Add Database Instance - Options PVC.png|border=1!


Click *Next* to continue.



10. In the final _Summary_ section, review the settings you have selected in the previous sections.

!Add Database Instance - Summary PVC.png|border=1!


Once you have verified that the specified settings are correct, click the *Add* button to add your MySQL Instance to the Policy.

11. The _Add Database Instance_ window closes, and the added MySQL Instance appears on the _MySQL_ tab of the _Edit Policy_ window. Instance options are displayed in the appropriate columns.

!Edit Policy - PVC example.png|border=1!


12. Click the *Save* button to save the policy.{excerpt:hidden=true}Instructions on how to add a MySQL instance on a PVC container to a policy in Server Backup Manager.{excerpt}