Setup failed: Database does not exist or you don't have permissions to connect to it

10 months ago
I get the above error when trying to install (http(s)://domain/install) in both 4.60.0 & 4.60.3. (for 4.60.3 I installed the 7.07 hosting bundle, however I used 7.02 hosting bundle for nopCommerce 4.60.0).

The SqlServer hosting the database is installed on a different server than the IIS hosting nopCommerce.

I have tested the connection to the database using SqlCmd from the same server where IIS is installed (no problem connecting the relevant database).

On the install page, I have tried both with and without entering raw connection string.

I have earlier had success installing 4.60.0 and therefore I think the problem is with my setup not with nopCommerce.

Anybody have any idea what could be wrong or how to move forward?
10 months ago
RE: "don't have permissions to connect to it"

When you tested with SqlCmd, what type of login are you using?  SQL user or Integrated Windows Authentication?
10 months ago
SqlServer Authentication (not integrated)
10 months ago
Using Visual Studio to debug, the exception happens in Libraries\Nop.Data\DataProviders\MsSqlDataProvider.cs line 116 : await connection.OpenAsync();

The exception reads :
Microsoft.Data.SqlClient.SqlException: 'A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SNI_PN11, error: 26 - Error Locating Server/Instance Specified)'
10 months ago
What version of SQL server?

Post here the raw Connection String  (with user/pwd removed;)
10 months ago
The problem is now solved.

I am not sure what the problem was (I could connect from SqlCmd, and also from a custom test app using the exact same connection string). I have now simplified the network topology and therefore I am unable to backtrack the problem.

However, just to answer your question:

1) Sql Server : SQL Express 2019 - 15.0.2000.5 (X64)

2) Connection String : Data Source=192.168.xx.xx\\sqlexpress;Initial Catalog=xxxx;Integrated Security=False;Persist Security Info=False;User ID=xxxx;Password=xxxx;Trust Server Certificate=True

(the above connection string is copied from a debug session, hence the 2 backslashes).

Note : I am pretty confident the problem was NOT with nopCommerce - nopCommerce and database connection works like a charm in my simplified network setup.

Thanks for the interest in the problem, knowing people are out to help actually helps.