Zend Server Cloud Integration Guide > IBM Bluemix Integration > Binding an External Database Service

Binding an External MYSQL Database Service

This topic describes how to bind an external database to the Zend Server application as a user-provided service. Doing so will enable persistence, session clustering, and more. You can perform this procedure during the deployment of your application, or at any stage after deployment.

 

 

Instructions on how to complete a procedure

To bind an external database

  1. Open your CLI.

  2. Run the following command:

cf create-user-provided-service [service-name] -p “comma, separated, parameters, names”

The required parameters are 'hostname', 'port', 'username' , 'password', 'name' (where 'name' is the database Zend Server will use for its internal functions).

  1. Enter the values for each parameter in order.
  2. Run the following command to bind the MySQL service to your application:

cf bind-service [service-name] [app-name]

  1. Restart your application for Zend Server buildpack to detect changes and create cluster:

cf restart [app-name]

Zend Server will create the MySQL database schema and enable clustering features.

 

Note:

To use the database parameters in an application, use the PHP getenv function to extract them from the VCAP_SERVICES environment variable.

 

Read Also

  Cloud Foundry Integration    
  Binding an External Database Service    
 

Retaining Cloud Foundry Application Configurations