none
Cannot connect to the configuration database RRS feed

  • Question

  • When going to any site on my server it says "Cannot connect to the configuration database".

    Any help would be appreciated.

    Mike W


    SharePoint Engineer - Mike

    Thursday, September 26, 2019 2:31 PM

All replies

  • Make Sure your SQL instances running fine the one SharePoint is using.

    https://www.sharepointdiary.com/2013/11/cannot-connect-to-the-configuration-database-error.html

    Thanks & Regards,


    sharath aluri

    Thursday, September 26, 2019 2:33 PM
  • The SQL instances are running correctly. Is it a PowerShell Script to connect the Server back to the Configuration Database?

    SharePoint Engineer - Mike


    Thursday, September 26, 2019 3:19 PM
  • Below is the PowerShell Script to connect server back to Configuration Database.

    Add-Pssnapin "Microsoft.SharePoint.PowerShell"
    $DbName = "SP_Extranet_Config"
    $DbServer = "sql01.mikefrobbins.com"
    $Passphrase = Read-Host -assecurestring "SP PassPhrase"
    Connect-SPConfigurationDatabase -DatabaseServer $DbServer -DatabaseName $DbName -Passphrase $Passphrase
    Install-SPHelpCollection -All
    Initialize-SPResourceSecurity
    Install-SPService
    Install-SPFeature -AllExistingFeatures
    Install-SPApplicationContent
    Thanks & Regards,


    sharath aluri

    Thursday, September 26, 2019 3:49 PM
  • Hi Mike,

    The possible reasons for this issue could be:

    There are many reasons why:

    • You applied a Hotfix or Service Pack to your SQL Server and have not restarted the SQL Server.
    • The SQL database may not be running.
    • The account that is used by application pool does not have the required permissions to the SQL Server database.
    • Network connectivity has been lost between the SharePoint Server and the Microsoft SQL Server server.

    There are different ways to check all possibilities. Few of them are as below:

    1) Verify that the SQL database is running and services.

    2) Firewall can block access and communication with your Microsoft SQL Server Server.

    Please find the below article explaining the same.

    https://mysharepointsolution.wordpress.com/2012/10/11/how-to-fix-cannot-connect-to-the-configuration-database/

    Hope that helps.

    Regards,

    Krishna

    Thursday, September 26, 2019 3:56 PM
  • My Datasource says                                                                                                                                                                                            Data Source=SharePointDBAlias


    SharePoint Engineer - Mike

    Thursday, September 26, 2019 6:38 PM
  • Mike,

    May I know where do you see this ? If time permits please share me the screen shot to help you better.

    Regards,

    Krishna

    Thursday, September 26, 2019 7:08 PM
  • It's not my private instance, so I'm not able to share a screen shot. However, here what it says below.

    Name              Type                      Data

    dsn                REG_S2                   Data Source=SharePoint=SharePointDBAlias     

    Mike W     


    SharePoint Engineer - Mike

    Thursday, September 26, 2019 8:18 PM
  • On the Server in the Registry Editor

    HKey_Local_Machine ----> Software------>Microsoft-------Shared Tools------>Web Server Extensions-------14.0------->ConfigDB


    SharePoint Engineer - Mike


    Thursday, September 26, 2019 8:25 PM
  • Where do I find the PassPhrase?

    SharePoint Engineer - Mike

    Thursday, September 26, 2019 8:26 PM
  • Will this reattach the Server to the Config Database? 

    SharePoint Engineer - Mike

    Thursday, September 26, 2019 8:27 PM
  • The Passphrase is the one that you uses to add extra/New Servers to the farm, This will be used when you configured SharePoint for the first time. If you forget then the only way you could do is reset the passphrase using the below commands. Yes that will add your Server to the Config Database. make sure you run this below commands in existing sharePoint farm not on New Server.
    $passphrase = ConvertTo-SecureString -asPlainText -Force
    
    Set-SPPassPhrase -PassPhrase $passphrase -Confirm
    
    Get-Help Set-SPPassPhrase -Detailed
    Thanks & Regards,


    sharath aluri

    Thursday, September 26, 2019 9:17 PM
  • Hi Mike, 

    If Sharath's reply helps you, please remember to mark it as an answer.

    Thanks for your understanding. 

    Best Regards, 

    Lisa Chen 

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, September 27, 2019 1:58 AM
    Moderator
  • I'm still confirming that the solution works with the DBA.

    Mike W


    SharePoint Engineer - Mike

    Friday, September 27, 2019 5:54 PM
  • When I try to reset the PassPhrase using this script it says

    Set-SPPassPhrase : Cannot access the local farm. Verify that the local farm is properly configured,

      currently available, and that you have the appropriate permissions to access the database before trying again.


    SharePoint Engineer - Mike

    Friday, September 27, 2019 7:37 PM
  • The account you are using should have DBCreator & Security Admin access from SQL end. and also add the user under SharePoint_Shell_Access role.

    Add-SPShellAdmin -UserName CONTOSO\User1
    Thanks & Regards,


    sharath aluri

    Friday, September 27, 2019 8:34 PM
  • Hi Mike,

    Are you able to read the "SharePoint_Config" database using PowerShell Command?

    You may try with the dismounting the particular content database which is connected to the site and mount that content database back to the site again and do the IISReset.

    You may check - if any firewalls blocking the communication between SQL server and SharePoint server.

    If nothing works - you might try with running the configuration wizard successfully but in this make sure you take all necessary backups before doing that.

    List of Back ups might be followings:

    1. SharePoint all databases(content databases, config databases and and all service application databases).

    2. All servers connected to the farm - need to take snapshot backup including the SQL server.

    3. If you have availability group in place in SQL - you need remove the "wss_usageapplication" database(log database) from availability group and after successfully running the configuration wizard, you need to add the "wss_usageapplication" database back to availability group.  



    Thanks&Regards,

    Habibur Rahaman

    MCSA,MCP,MCTS

    My Certificates

    Note: If you feel the proposed answer is helpful, please mark as so or if this answered your question,please mark as answer.


    • Edited by Habibur Rahaman Sunday, September 29, 2019 12:38 PM Added more info
    Sunday, September 29, 2019 12:35 PM
  • Thanks Habibur,

    Which command do I use to run the Configuration Wizard?

    

    SharePoint Engineer - Mike

    Monday, September 30, 2019 2:06 PM
  • Sharath,

    This did not work. Can not access the local farm. Verify that the local farm is properly configured, currently available, and that you have the appropriate permissions to access the database before trying again.


    SharePoint Engineer - Mike

    Monday, September 30, 2019 2:15 PM
  • Do I run this command on the SharePoint Server or the SQL Server??

    SharePoint Engineer - Mike

    Monday, September 30, 2019 3:07 PM
  • When I run the below script line, it gives me the error below:

    Set-SPPassPhrase : Cannot access the local farm, verify the local farm is properly configured


    SharePoint Engineer - Mike

    Monday, September 30, 2019 3:42 PM
  • Hi Mike,

    You don't need run the command - you run the wizard from the SharePoint installation wizard UI. From SharePoint server click - open SharePoint Configuration Wizard as an administrator from start menu.


    Thanks&Regards,

    Habibur Rahaman

    MCSA,MCP,MCTS

    My Certificates

    Note: If you feel the proposed answer is helpful, please mark as so or if this answered your question,please mark as answer.

    Monday, September 30, 2019 6:11 PM
  • Do I run this command on the SharePoint Server or the SQL Server??

    SharePoint Engineer - Mike

    Command has to be run from SharePoint Server.

    Thanks & Regards,


    sharath aluri

    Monday, September 30, 2019 7:44 PM
  • I did that, but it's still asking for the Passphrase to proceed.

    SharePoint Engineer - Mike

    Monday, September 30, 2019 8:27 PM
  • It will definitely ask for PassPhrase no matter you use SharePoint UI or PowerShell. Just Make Sure you have enough permissions and also don't forget to add your farm account in Shell Admin Access.

    Thanks & Regards,


    sharath aluri

    Tuesday, October 1, 2019 1:08 AM
  • I will try this in the morning. Thank you.

    SharePoint Engineer - Mike

    Tuesday, October 1, 2019 3:37 AM
  • My farm account is in Shell Admin Access.

    SharePoint Engineer - Mike

    Tuesday, October 1, 2019 2:59 PM
  • Hmmm, Add Shell Access manually to a specific Config_Database under the properties of that database.

    Thanks & Regards,


    sharath aluri

    Tuesday, October 1, 2019 4:04 PM
  • I'm not that good with databases......could you elaborate a little?

    Right Click on the SharePoint_Config(Synchronized) database ------>Click on Properties------->Select a page(click on Permissions) 


    SharePoint Engineer - Mike


    Tuesday, October 1, 2019 4:50 PM
  • Never Mind !! If you have already run the above command then just make sure you account is under. Try running the below command it should display all users who have shell access. and also ensures the user is added to the WSS_Admin_WPG local group on each server in the SharePoint farm. then try running passphrase.

    Get-SPShellAdmin
    Thanks & Regards,


    sharath aluri

    Tuesday, October 1, 2019 5:55 PM
  • I get an Error when running that command

    Object reference not set to an instance of an object.

    At line:1 char:17

    + Get-SPShellAdmin  <<<<<

         + CategoryInfo                 : InvalidData:  (Microsoft.Share...GetSPShellAdmin:SPCmdletGetSPShellAdmin) [Get-SPShellAdmin], NullReferenceException  +  FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletGetSPShellAdmin


    SharePoint Engineer - Mike

    Tuesday, October 1, 2019 6:06 PM
  • https://docs.microsoft.com/en-us/powershell/module/sharepoint-server/Add-SPShellAdmin?redirectedfrom=MSDN&view=sharepoint-ps

    Check the SQL database permissions outlined at the top of the article. Specifically the account running the Get-SPShellAdmin commands must have SecurityAdmin server role in SQL, and db_owner against all databases being configured.

    It looks like your SQL permissions may be misconfigured so it's probably worth verifying them against this article below.

    https://docs.microsoft.com/en-us/SharePoint/install/account-permissions-and-security-settings-in-sharepoint-2013?redirectedfrom=MSDN

    Thanks & Regards,


    sharath aluri

    Tuesday, October 1, 2019 6:16 PM
  • I connected farm backup to the configuration database with the SharePoint 2919 Product Configuration and Central and central administration came backup. However the Site Collection did not come backup. I got the message of "The webpage cannot be found".

    When I came in this morning central administration wasn't able to come up as well. It was like the Configuration Database detached itself by itself. Any idea what could be causing this. I'm think it's a corrupt configuration file or database.


    SharePoint Engineer - Mike


    Thursday, October 10, 2019 2:15 PM