1. Home
  2. Knowledge Base
  3. Web hosting
  4. What is a database connection string?

What is a database connection string?

A connection string is the piece of information that is needed for your application to reach your database, for example a database name, username, password, port etc…

Example of a PHP connection string:

WordPress:

define('DB_NAME', 'ID111111_database_name');
/* MySQL database username /
define('DB_USER', 'ID111111_user_example'');
/* MySQL database password /
define('DB_PASSWORD', 'database-password');
/* MySQL hostname /
define('DB_HOST', ‘mysql001.webhosting.be');

Joomla:

public $host = ‘mysql001.webhosting.be';
public $user = 'ID111111_user_example';
public $password = 'database-password';
public $db = 'ID111111_database_name';

Drupal:

$databases = array (
    'default' =>
    array (
        'default' =>
        array (
            'database' => 'ID111111_database_name',
            'username' => 'ID111111_user_example’,
            'password' => 'database-password',
            'host' => ‘mysql001.webhosting.be',
            'port' => '',
            'driver' => 'mysql',
            'prefix' => '',
        ),
    ),
);
Updated on 8 March 2020

Was this article helpful?

Need support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact support

Couldn't find a solution?

support_bottom_contact_alt

Our specialists are available 24/7 to provide you with free support. Feel free to contact Joachim and his colleagues via e-mail or by phone.

support_bottom_contact_alt
Joachim Coessens Specialist Support