Website cannot connect to MSSQL database server

Refers to:

  • Plesk Onyx for Windows
  • Plesk 11.0 for Windows
  • Plesk 11.5 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Created:

2016-11-16 12:41:03 UTC

Modified:

2017-02-02 07:02:11 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Website cannot connect to MSSQL database server

Symptoms

1. The following error occurs on attempt to access a website developed with ASP.NET:

Server=127.0.0.1;Database=mydatabase_name;Trusted_Connection=True;
Cannot open database "mydatabase_name" requested by the login. The login failed.
Login failed for user 'qwerty'

2. ASP.NET website keeps loading and get connection error

Cause

The database user cannot connect to the database due to an incorrect password or database connection settings is misconfigured in ASP.NET Settings for the domain.

Resolution

  1. If the connection to database is managed though the web.config file in the site's document root ( D:\\inetpub\\vhosts\\domain.test\\httpdocs ), find the section connectionStrings in web.config :

    <connectionStrings>
    <add name="QweConnectionString" connectionString="Server=127.0.0.1\\MSSQLSERVER2008;
    Database=mydatabase_name;Uid=qwerty;Password=1qazXSW@" />
    </connectionStrings>
  2. Set the password of the database user through the Parallels Plesk interface (at Websites & Domains > Databases > Users > username ) to the same value as in web.config .

  3. Check that database server specified in connectionString parameter exists and configured properly.

 

Have more questions? Submit a request
Please sign in to leave a comment.