none
SharePoint 2013 - error when mounting content database with database server name RRS feed

  • Question

  • Hi

    SharePoint 2013 farm

    backup Test_ContentDB2 database from sqlserverdb1 of farm1 and restore  to sqlserverdb2 on farm2

    When I try to mount the database, I got this error when mounting a content database and using a server name in the cmdlet.

    Mount-SPContentDatabase -Name "Test_ContentDB2" -WebApplication TestDRWebApp -DatabaseServer  sqlserverdb2 -Verbose

    Mount-SPContentDatabase : Could not connect to sqlserverdb3 using integrated security: Cannot connect to database master at SQL server at sqlserverdb3. The database might not exist, or the current user does not have permission to connect to it

    if I don't use the server name then it work fine and the content database mounted OK

    Thanks for any suggestion to resolve this


    Swanl

    Wednesday, November 13, 2019 11:19 PM

Answers

  • Hi 

    Here are some trobleshooting check list,

    https://www.sharepointdiary.com/2016/11/cannot-connect-to-database-master-at-sql-server-database-might-not-exists-current-user-does-not-have-permission.html

    Troubleshooting Checklist:
    1. Check the permissions for the Setup account which you are using to run the wizard or PowerShell. Make sure the setup account is granted with "DB_Creator" and "Security_Admin" Server Roles.
    2. In case of Named instance, it should be "Server\InstanceName". If it is SQL Alias, make sure the alias is properly configured and should be accessible from SharePoint Server. Verify if the SQL Server Alias is created for both 32 and 64-bit! How to Create SQL Server Alias for SharePoint
    3. Check if the SQL Server Service is running on your Database Server. Verify "TCP/IP" protocol is enabled under Network Configuration section of SQL Server Configuration Manager. 
    4. Test the connectivity between SharePoint and SQL Server. Try adding a HOST file entry in your SharePoint Server to point the SQL Server's IP!
    5. Check the firewall rules on SQL Server. If firewall is enabled on SQL Server, Create inbound TCP rule with ports: 1433,2383,2382 (or whatever dynamic port your SQL server is running) and inbound UPD rule with port: 1434.
    6. Double check if you have not fat-fingered User Name or Password!


    Thanks


    Thursday, November 14, 2019 10:33 AM

All replies

  • Hi Swanl,

    The account that is running the configuration wizard (the "setup user account") requires dbcreator and securityadmin roles on in the database instance.

    • Setup user account
    • The Setup user account is used to run the following:
    • Setup
    • SharePoint Products Configuration Wizard 
    • Domain user account.
    • Member of the Administrators group on each server on which Setup is run.
    • SQL Server login on the computer that runs SQL Server.
    • Member of the following SQL Server security roles:

      • securityadmin fixed server role
      • dbcreator fixed server role

    If you run Windows PowerShell cmdlets that affect a database, this account must be a member of the db_owner fixed database role for the database.

    Make sure that the user running the command is in the SQL Role SharePoint_Shell_Access, if the user already exists, remove the user and re-add him as SA

    You can also refer to these similar situations:

    https://www.sharepointdiary.com/2016/11/cannot-connect-to-database-master-at-sql-server-database-might-not-exists-current-user-does-not-have-permission.html

    https://social.technet.microsoft.com/Forums/ie/en-US/c925ae3d-05db-4c4a-a560-789757ddeb74/cannot-connect-to-database-master-at-sql-server?forum=sharepointadminprevious

    Best regards

    Itch Sun


    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.

    Thursday, November 14, 2019 2:40 AM
  • Hi 

    Here are some trobleshooting check list,

    https://www.sharepointdiary.com/2016/11/cannot-connect-to-database-master-at-sql-server-database-might-not-exists-current-user-does-not-have-permission.html

    Troubleshooting Checklist:
    1. Check the permissions for the Setup account which you are using to run the wizard or PowerShell. Make sure the setup account is granted with "DB_Creator" and "Security_Admin" Server Roles.
    2. In case of Named instance, it should be "Server\InstanceName". If it is SQL Alias, make sure the alias is properly configured and should be accessible from SharePoint Server. Verify if the SQL Server Alias is created for both 32 and 64-bit! How to Create SQL Server Alias for SharePoint
    3. Check if the SQL Server Service is running on your Database Server. Verify "TCP/IP" protocol is enabled under Network Configuration section of SQL Server Configuration Manager. 
    4. Test the connectivity between SharePoint and SQL Server. Try adding a HOST file entry in your SharePoint Server to point the SQL Server's IP!
    5. Check the firewall rules on SQL Server. If firewall is enabled on SQL Server, Create inbound TCP rule with ports: 1433,2383,2382 (or whatever dynamic port your SQL server is running) and inbound UPD rule with port: 1434.
    6. Double check if you have not fat-fingered User Name or Password!


    Thanks


    Thursday, November 14, 2019 10:33 AM
  • Hi

    Thanks so much for your advise.  DBA checked and confirm with me that the account do have the permission.  as another advise I got is to remove and add back the account so will ask the DBA to do that now.

    will let you know how that go

    Thanks


    Swanl

    Thursday, November 14, 2019 4:12 PM
  • Hi

    Thanks for your checklist.  That is really help.  will follow those and make sure all settings or permission are there.

    will let you know.

    Thanks again


    Swanl

    Thursday, November 14, 2019 4:15 PM
  • Hi Swanl,

    I am checking your situation here.

    Any progress on your troubleshooting?

    Best regards

    Itch Sun


    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, November 15, 2019 7:44 AM
  • Hi Itch

    I had marked an answer.  thanks for following up.


    Swanl

    Monday, November 18, 2019 8:27 PM
  • Hi ME_77

    I had followed your steps and specifically number 5.  After FW rules setup for ports,  I am able to mount database successfully and access SharePoint sites in this database.

    All are working as expected.   Thanks again


    Swanl

    Wednesday, November 20, 2019 10:17 PM