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.
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.”
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.
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.
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.
- Check the SQL Server Service and SQL Agent and make sure both are started and worked properly.
- 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:
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.
- At “Server Roles”, make sure that the Dbcreator, Securityadmin roles have been checked.
SQL Server Network Configuration TCP/IP disabled.
- Check SQL Server Network Configuration TCP/IP status and ensure that it is Enabled.
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.
- Right Click > Select Properties.
- In firewall state > select off.
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.
In my case, the issue was related to the firewall settings, and it’s now working properly as shown below
- SharePoint 2016.
- SharePoint 2013.
- SharePoint 2010.