Connecting to a Database

RSS

Connecting to a Database

Last updated April 12th, 2018

You can connect to a MySQL database on Cloud Containers in much the same way you would connect in any other environment, with one key difference. The standard hostname of localhost will not work, instead you need to use mysqlhost. For example if you were setting up a WordPress install your wp-config.php database section would look something like this:

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'mysqlhost' );
Can we improve this article? Suggest an improvement to this article.

Suggest an Improvement

Thank you for helping us to improve this Knowledge Base article. Please type your suggestions below:

Still need help? Get in touch with us.

If you aren't able to find the help you need then please send us a question and we can help you further.