Score:0

Connecting to a local mySQL server using ASP.Net api

vn flag

I'm trying to connect to a mySQL DataBase running locally through XAMPP using an ASP.net API.

In appsettings.json in my API project I have set the connection string to:

"PACDB": "server=localhost:3306;database=pac;user=root;"

In phpMyAdmin user account settings, I have set a user with a username as 'root' with no password, host name as 'localhost' and granted it all privileges, but I still can't connect when I try to execute a Get command in Swagger.

Error I keep getting is:

'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)'

djdomi avatar
za flag
I think dba would better fit on this question imho
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.