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:


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');


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


$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?
Contact Support

Couldn't find a solution?


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.

Joachim Coessens Specialist Support