Unable to connect to mysql database in scaled OpenShift application

Solution Unverified - Updated -


  • In a scaled OpenShift Online application, the mysql database cannot be accessed through php. The following code is used:
$dbhost = getenv("OPENSHIFT_MYSQL_DB_HOST");
$dbuser = getenv("OPENSHIFT_MYSQL_DB_USERNAME");
$connection = mysql_connect($dbhost, $dbuser, $dbpwd);


  • OpenShift Online

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In