AhmedBinNasser
AhmedBinNasser

Reputation: 2732

Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database

I'm using Umbraco CMS v7.4 with SQL Server 2014, the project was working fine until a few hours ago, when an error started showing up:

Umbraco cannot start. A connection string is configured but the Umbraco cannot connect to the database

The error occurs when I tried to open the website, see the image below:

enter image description here

I tried the following:

Any help is appreciated.

Upvotes: 0

Views: 15226

Answers (5)

Nurhak Kaya
Nurhak Kaya

Reputation: 1781

I experienced the same problem and here is how I fixed it.

  • Right-click on your localhost in SSMS and select Properties
  • Got to the Security page and select "Select authentication" as "SQL Server and Windows Authentication mode"
  • Hit OK.
  • Go to Services and find your SQL Server service and restart it.
  • Check your local umbraco website now, you should be able to see it without any issues. If you still have problems, then you might need to check your local setup and permissions.
  • Further details are below and on this blog post. enter image description here enter image description here enter image description here

Upvotes: 0

Miklos Kanyo
Miklos Kanyo

Reputation: 196

Also note that if you're running it in Azure with an Azure SQL database you'll have to go to the Azure SQL Server settings and under "Firewalls and virtual networks" you'll need to tick "Yes" for "Allow Azure services and resources to access this server".

Upvotes: 1

IfElseTryCatch
IfElseTryCatch

Reputation: 494

I was getting this error when running an Umbraco project locally, with the DB pointing to an instance on Azure. In that case, this problem happens if you haven't allowed the IP access within the Server Firewall of the DB in Azure.

You can fix this by finding out your IP and then adding it to the DB:

  • Click All Resources within your Azure portal, then click on the SQL Database your project points to.
  • Click Set Server Firewall on the right-side window.
  • Add in your IP as the start and end points, and call it something memorable.
  • Click Save and once you get the confirmation message that It has been applied, refresh your site locally.

Upvotes: 0

avs099
avs099

Reputation: 11227

So, in my case I tried to get started with the existing project. I got all the files, restored DB backup locally, made sure all permissions are set for IIS AppPool user etc. But I kept getting the error in question. It turns out that I cannot use server=localhost;database=... in connection string. After I replaced it with server=.\;database=..., it started to work right away.

Upvotes: 2

AhmedBinNasser
AhmedBinNasser

Reputation: 2732

After a few tries, even I loaded the backed up DB, I found that it caused by the DB login, the user in the connection string was having a password expiration enabled (the password had expired).

So, this is what I did:

  • Open the SQL server
  • Logged in as the user used in the connection string
  • Created a new password
  • Updated the web.config connection string "Password"

Hope this will help

Upvotes: 2

Related Questions