Updating the MySQL max connections setting

The MySQL database will start giving too many connection errors when all the available connections are in use by other clients. In this recipe, you will learn how to update the MySQL cartridge max connections setting.

Getting ready

To complete this recipe, you will need an application with a MySQL cartridge. Please refer to the Adding a MySQL cartridge to your application recipe of this chapter to learn how to install the MySQL cartridge.

How to do it…

Follow these steps to update the MySQL max connection setting:

  1. To set the maximum connections to 200, open a command-line terminal, and run the following command:
    $ rhc env-set OPENSHIFT_MYSQL_MAX_CONNECTIONS=200 --app myapp
    
  2. After setting the environment variable, ...

Get OpenShift Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.