Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL server Error 4060

4060 "Server rejected the connection; Access to selected database has been denied".

How can I troubleshoot this error?

like image 563
Haranadh Avatar asked Apr 09 '09 11:04

Haranadh


3 Answers

This error also occurs if the Database not exists

so make sure that there is a database with the name you provided in Catalog=MyDB

like image 172
Salmakis Avatar answered Nov 03 '22 23:11

Salmakis


Do you have permission to access the database using the credentials that you are supplying? What provider are you trying to use? TCP/IP, Named Pipes? Has that provider been enabled? Is there a firewall in place and have you opened up the port to the client? Does this happen intermittently? If so, do you have enough licenses available when the error occurs? You might want to check the server error logs (and your client event log, too) for more information.

like image 38
tvanfosson Avatar answered Nov 04 '22 00:11

tvanfosson


User credentials are ok, but user doesn't have the right to connect to the given database, you should grant him all rights needed...

like image 2
que dal Avatar answered Nov 04 '22 00:11

que dal