Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect

In this article, I will solve the below SharePoint issue

Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect to it.


Scenario

After I had installed SharePoint, I checked Run SharePoint Product Configuration Wizard to configure the SharePoint Farm.

In “Specify Configuration Database Settings” step, I have provided the server name setting with the correct farm account credentials, but I got the below error :

“Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect to it.”

Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect to it


Cause

The “Cannot connect to database master at SQL server at SERVERNAME” issue might occur in case,

  • The Database Server is not reachable from the SharePoint Application Server.
  • The SQL Server port is closed and is not accessible from SharePoint Application Server.
  • The domain user credentials maybe not provided correctly.
  • SQL Server Service is stopped.
  • SQL Agent is stopped.
  • SQL Server Browser is stopped.
  • The provided domain user (Farm Account) doesn’t have sufficient permission (dbCreator, SecurityAdmin) to access DB Server.
  • SQL Server Network Configuration TCP/IP is disabled.
  • SQL Server server was blocked by Firewall.

Solution

The Database Server is not reachable from the SharePoint Application Server

  • Make sure that the Database server is up and running.
  • From the SharePoint Application Server, try to ping the SQL Server Virtual IP to make sure that it’s reachable.

Check also Check the connectivity between the application server and SQL server instance on the database server.


The SQL Server port is closed and is not accessible from SharePoint Application Server

The default SQL Server Port is 1433, so make sure that you can telnet the SQL Server Virtual IP on SQL Server Port.


telnet "the SQL Server IP" 1433

Check the details at  Check the SQL Server connectivity.


The farm account credential is not correct

Make sure that you have provided the correct farm account credential. try to type it again.


SQL Server Service is stopped.

  • Open SQL Server Configuration Wizard.

SQL Server Configuration manager

  • Check the SQL Server Service and SQL Agent and make sure both are started and worked properly.

SQL service Started

  • If it is not running, try to start it.

Check also SQL SERVER SERVICE IS NOT STARTING!


The Farm Account doesn’t have sufficient permissions to connect to DB Server.

Make sure that the Provided account is the farm account that should have the below server roles:

  • dbCreator.
  • Securityadmin.
Provide the SharePoint Farm Account the required Permissions in SQL Server.
  • Open SQL Management Studio > Connect to SQL Server using sysadmin account.
  • Go to Security > New Login > search for the Farm Account.

Add SharePoint Farm Account to SQL Server

  • At “Server Roles”, make sure that the DbcreatorSecurityadmin roles have been checked.

Provide the SharePoint Farm Account the required Permissions in SQL Server.


SQL Server Network Configuration TCP/IP disabled.

  •  Check SQL Server Network Configuration TCP/IP status and ensure that it is Enabled.

Sql Server Netowrk Configration


SQL Server server was blocked by Firewall.

If all previous steps did not solve the issue, so you need to check Firewall Settings. where Firewall may be blocking the access to Microsoft SQL Server server,

In this case, you have 3 options:

Disable Firewall,(Not recommended)

  • Open Windows Firewall with Advanced Security.

Open windows firewall with advanced security.

  • Right Click > Select Properties.

Windows Firewall with Advanced Security properties

  • In firewall state > select off.

Disable Firewall

Adjust Firewall to Allow Inbound Connections Rules.

  • Set FireWall State to “Allow”.
  • Create Two Inbound Connections Rules as the following:
    • One inbound TCP rule with ports: 1433,2383,2382.
    • One inbound UPD rule with port: 1434.

firewall allow inbound connections rules


In my case, the issue was related to the firewall settings, and it’s now working properly as shown below

Specify Farm Security Settings


Applies To

  • SharePoint 2016.
  • SharePoint 2013.
  • SharePoint 2010.
Advertisements

3 thoughts on “Cannot connect to database master at SQL server at SERVERNAME. The database might not exist, or the current user does not have permission to connect

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s