13.5.5. Database Environment Variables

Database environment variables pertain to a database, if one exists, and are used to connect an application to a database. The exact variable names depend on the type of database; the value of <database> is MONGODB, MYSQL, or POSTGRESQL as appropriate. Note that these connections are only available to an application internally; you cannot connect from an external source.
OpenShift Online does not currently support user changes to environment variables. This includes changing the default MySQL admin password (even outside of phpMyAdmin). If the password is changed, ensure the change takes effect correctly. Note that this restriction only applies to the default administrative user. You can add more users as required, and specify a custom password for these users.

Table 13.6. Database Environment Variables

Environment Variable Name Purpose
OPENSHIFT_Cart_Name_DB_HOST The host name or IP address used to connect to the database.
OPENSHIFT_Cart_Name_DB_PORT The port the database server is listening on.
OPENSHIFT_Cart_Name_DB_USERNAME The database administrative user name.
OPENSHIFT_Cart_Name_DB_PASSWORD The database administrative user's password.
OPENSHIFT_Cart_Name_DB_SOCKET An AF socket for connecting to the database (for non-scaled apps only).
OPENSHIFT_Cart_Name_DB_URL Database connection URL.