djacktx

Registered
Feb 7, 2023
3
0
1
76180
cPanel Access Level
Website Owner
I am hosted here on a premium package and setup the mysql database successfully. I added a user and granted remote access. I have an app that I created that connects to the database to pull info. When I try to connect, I get the error: "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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)".

However, I can log in to the database just fine via MYSQL workbench. I have the correct server which is my domain name and I have tried with the IP address as well. I can connect to my old database via the app but when I use the new database info I get the error? Any thoughts on what I could have missed?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,423
363
cPanel Access Level
Root Administrator
Hey there! Just to confirm, the same application can connect when you use databaseA but NOT when you use databaseB, correct? If so, I'm not sure what would cause that since it would be using the same connection string and hostname to establish that connection, with the only difference being the database name and username.

It might be best to contact your hosting provider or datacenter to have them check that the remote access is properly granted to the database on the MySQL side of things.
 

djacktx

Registered
Feb 7, 2023
3
0
1
76180
cPanel Access Level
Website Owner
I have the old database (A) and I am moving to new database (B). I can connect to both databases using MySQL Workbench and Visual Studio's Server Explorer. When I change to database B and build the app, it will not connect to it. Shows the error mentioned above. I switch back to database A in the app and it connects just fine. Since I can connect to database B via several programs I would say the database is working and access is fine. So I am leaning toward the way Visual Studio is building the connection in the app unless anyone else has other ideas.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,423
363
cPanel Access Level
Root Administrator
That sounds logical to me - since other external tools (MySQL Workbench) are able to connect, the issue wouldn't be with the external connection or the database's authentication details.

Let us know if you find anything else with your troubleshooting!
 

djacktx

Registered
Feb 7, 2023
3
0
1
76180
cPanel Access Level
Website Owner
I did find the actual issue and I feel stupid for not seeing it earlier. I forgot that I am transitioning from an MSSQL database to a MySQL database and needed to change some client info in the app. Once I did that it started working perfectly.