View Source

To set up a MySQL database on a Parallels Virtuozzo Containers (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 below.

Follow the instructions below to add a MySQL Instance to a PVC container on your CDP Enterprise or Advanced Edition Policy.

You can also find a detailed description of the "Add New MySQL Instance" wizard in [Adding a MySQL Instance to a Policy|Adding a MySQL Instance to a Policy].

1. Select the "MySQL" tab in the Policy window. You can do this while [creating a new Policy|Creating Policies] 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 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|Installing the MySQL Connector JDBC into CDP3 Server] for detailed instructions on how to install the driver.

4. On the following "Name" screen, define the name for your database, and enable the database Instance. The name will be displayed in the Policy's "MySQL" tab.


Click "Next."

5. The next wizard screen is "Host." Here you can enter the information about the host to connect to.

Add the IP address of the MySQL PVC container.

!Enterprise edition_Add Database Instance_Host.png!

Click "Next."

!enterprise edition_next.png!

6. On the "Authentication" screen, specify the authentication credentials to connect to the database Instance.

* *Username*
* *Password*
* *Confirm Password*

!Enterprise edition_Add Database Instance_Authentication.png!

Click "Next."

7. On the "Data Directory" screen, 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}}.

{info:title=Note}Do *not* provide the full path of the Hardware Node.{info}

!Enterprise edition_Add Database Instance_Data Directory2.png!

Click "Next." 

8. On the following screen, specify a base directory (if it differs from the standard directory) to use if the automatic method fails.


Click "Next."

9. On the "Options" screen, supply the "Virtuozzo Container ID."

!Enterprise edition_Virtuozzo Container ID specified.png!

Click "Next." 

!enterprise edition_next.png!

10. On the last "Summary" screen, the settings you have selected are displayed.

!Enterprise edition_Add Database Instance_Summary2.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 Policy window. Instance options are displayed in the appropriate columns.

!Enterprise edition_Policy Details for Policy 1_2.png!

13. Save the Policy.

!save-policy.png! {excerpt:hidden=true}Instructions on how to add a MySQL Instance on a PVC container to a Policy.{excerpt}