Accessing Databases with Connection Strings

Another method of connecting to a database is using a connection string. A connection string is a string that contains information about a data source (usually a database engine), as well as the information necessary to connect to it. While the exact syntax of a connection string varies depending on the data source (for example, a connection string meant to connect to a MySQL database server will look different than one for a PostgreSQL server), you will usually be required to specify the following data:

  • Database server address. To find out your database server address do the following:
    1. Go to Websites & Domains and click Databases.
    2. Click the Webadmin link for one of your databases.
    3. At the top of the screen look for an entry of the following form "Server:". In this example, ‘’ is the database server address. If the server name is specified like ‘localhost’, contact your hosting provider to find out your database server address.
  • Database name. To find out the exact name of your database, go to Websites & Domains and click Databases to see the list of your databases.
  • Database user login and password. To find out the login of the database user, do the following:
    1. Go to Websites & Domains and click Databases.
    2. Note the name in the Users column next to the database to which you want to connect using the connection string.

    If you do not remember the user’s password, you can reset it. To reset the user’s password, do the following:

    1. Go to Websites & Domains and click Databases.
    2. Click User Management and click the corresponding name in the Name column.
    3. Type in the new password and confirm it. Click OK.

This document does not aim to provide an in-depth description of connection strings’ syntax. If you want to learn more about the subject, we recommend that you visit for more information.


Leave your comments on this page

Leave your feedback or question on this documentation topic below. For technical assistance, contact your hosting service provider or submit a request to Plesk support. Suggest new features for Plesk here. Discuss general questions on the Plesk forum. All offtopic comments will be removed.