When trying to create a new SharePoint farm using PowerShell, the SharePoint 2016 management Shell gave an error message:
New-SPConfigurationDatabase : Cannot connect to database master at SQL server at <SQL-Server-Alias>. The database might not exist, or the current user does not have permission to connect to it.
I also tried using SharePoint products configuration wizard and got the same issue!
- 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.
- If you are using the default instance, just enter the host name instead of FQDN. In case of the 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
- Check if the SQL Server Service is running on your Database Server. Verify “TCP/IP” protocol is enabled under the Network Configuration section of SQL Server Configuration Manager.
- Test the connectivity between SharePoint and SQL Server. Try adding a HOST file entry in your SharePoint Server to point to the SQL Server’s IP!
- Check the firewall rules on SQL Server. If the 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.
- Double check if you have not fat-fingered User Name or Password!