Umbraco cannot start. A connection string is confi

2019-09-12 15:48发布

问题:

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:

I tried the following:

  • Checked to see if SQL Server is running
  • Checked the connection string credentials in web.config

Any help is appreciated.

回答1:

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



回答2:

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.



回答3:

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.