Connection Failed Sqlstate 42000 Sql Server Error 4060
Contents |
SERVER - FIX : ERROR : Cannot open database requested by the login. The login failed. Login failed for user ‘NT AUTHORITY\NETWORK SERVICE'. August 20, 2009Pinal DaveSQL, SQL Server, SQL Tips and Tricks192 commentsThis connection failed sqlstate 42000 sql server error 18456 error is quite common and I have received it few times sqlstate 42000 sql server error 18456 login failed while I was working on a recent consultation project.Cannot open database requested by the login. The login failed. sqlstate 42000 sql server error 4064 Login failed for user ‘NT AUTHORITY\NETWORK SERVICE'.This error occurs when you have configured your application with IIS, and IIS goes to SQL Server and tries to login with credentials
Sql Server Sqlstate 42000 Error 50000
that do not have proper permissions. This error can also occur when replication or mirroring is set up.If you search online, there are many different solutions provided to solve this error, and many of these solutions work fine. However, I will be going over a solution that works always and is very simple.Fix/Workaround/Solution:Go to SQL Server >> Security >> connection failed sqlstate 42000 syntax error or access violation 1064 Logins and right click on NT AUTHORITY\NETWORK SERVICE and select PropertiesIn newly opened screen of Login Properties, go to the “User Mapping” tab. Then, on the “User Mapping” tab, select the desired database – especially the database for which this error message is displayed. On the lower screen, check the role db_owner. Click OK.In almost all such cases, this should fix your problem.Reference : Pinal Dave (http://blog.sqlauthority.com) Tags: SQL Error Messages, SQL Login, SQL Scripts, SQL Server Security3Related Articles SQL SERVER - Find Collation of Database and Table Column Using T-SQL December 16, 2008Pinal Dave SQL SERVER - Retrieve SQL Server Installation Date Time July 5, 2012Pinal Dave SQL SERVER - Fix: Error 147 An aggregate may not appear in the WHERE clause June 3, 2012Pinal Dave 192 comments. Leave new Jay May 21, 2014 7:20 pmAwesome solution, thanks a load :)Reply alireza June 28, 2014 11:52 amtank you very much . my problem solved (:Reply Muhammad Rafi July 8, 2014 12:22 pmnot working for me. Please tell me why?Reply Rajeev August 7, 2014 3:
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us sql server cannot open database requested by the login. the login failed Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community
Microsoft Sql Server Error 4060
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up SQL
Sql Server Error 4060 Server Rejected The Connection
server Error 4060 up vote 1 down vote favorite 1 4060 "Server rejected the connection; Access to selected database has been denied". How can I troubleshoot this error? sql-server-2005 security share|improve this question edited Apr 9 '09 at 11:15 Will 95.8k41233337 asked http://blog.sqlauthority.com/2009/08/20/sql-server-fix-error-cannot-open-database-requested-by-the-login-the-login-failed-login-failed-for-user-nt-authoritynetwork-service/ Apr 9 '09 at 11:06 Haranadh 2272610 from where are you trying to connect to the sql server? if from code, then it would be good to give us the connection string that you are using –Konstantinos Apr 9 '09 at 11:18 my case was misspelled database name –shareef Jun 22 '15 at 11:45 add a comment| 3 Answers 3 active oldest votes up vote 1 down vote Do you have permission to access the database using the credentials that you http://stackoverflow.com/questions/733744/sql-server-error-4060 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. share|improve this answer answered Apr 9 '09 at 11:18 tvanfosson 350k65568700 add a comment| up vote 1 down vote User credentials are ok, but user doesn't have the right to connect to the given database, you should grant him all rights needed... share|improve this answer answered Sep 24 '12 at 16:44 que dal 711 1 could you elaborate how this might be done? –Andy Hayden Sep 24 '12 at 20:57 what happens is that the user/pass are provided to sql, AND credentials are correct, AND before connecting the user to the database requested for the connection, sql tries to connect the user to the user's default database, which turns to be, in Haranadh's case not granted to the user in question. that's it. –que dal Jun 6 '13 at 14:31 add a comment| up vote 0 down vote You're most likely don't have the necessary permissions to access the database, or there isn't a database which correspond to the information you specified. share|improve this answer answered Apr 9 '09 at 11:25 Moayad Mardini 5,62252957 And how would you change the informatio
up Recent PostsRecent Posts Popular TopicsPopular Topics Home Search Members Calendar Who's On Home » SQL Server 2005 » http://www.sqlservercentral.com/Forums/Topic675541-146-1.aspx Administering » SQLServer Error: 4060, Cannot open database SQLServer Error: 4060, Cannot open http://www.dslreports.com/forum/r28627904-Windows-This-guy-needs-a-little-SQL-DB-help database Rate Topic Display Mode Topic Options Author Message branovukbranovuk Posted Friday, March 13, 2009 1:35 PM Valued Member Group: General Forum Members Last Login: Friday, May 30, 2014 9:03 AM Points: 68, Visits: 307 Strange behavior:[298] SQLServer Error: 4060, Cannot open database "TestDB" requested by the login. The login failed. [SQLSTATE sql server 42000][298] SQLServer Error: 18456, Login failed for user 'DOMAIN\Administrator'. [SQLSTATE 28000]The problem is: I deleted that TestDB a day ago. It does not exist anymore!What am I missing?ThanksBrano Post #675541 Roy ErnestRoy Ernest Posted Friday, March 13, 2009 1:54 PM SSCrazy Group: General Forum Members Last Login: Today @ 11:55 AM Points: 2,381, Visits: 6,849 Do you have any Jobs, Scheduled tasks or something running that sql server error connects to that DB? -Roy Post #675553 branovukbranovuk Posted Friday, March 13, 2009 2:07 PM Valued Member Group: General Forum Members Last Login: Friday, May 30, 2014 9:03 AM Points: 68, Visits: 307 Thank you, that solved issue. I overlooked that sharepoint installation created job CDW_SHAREPOINT for that database.It is gone.Regards,Brano Post #675559 Roy ErnestRoy Ernest Posted Friday, March 13, 2009 2:10 PM SSCrazy Group: General Forum Members Last Login: Today @ 11:55 AM Points: 2,381, Visits: 6,849 Glad I could help.. :) -Roy Post #675565 « Prev Topic | Next Topic » Permissions You cannot post new topics. You cannot post topic replies. You cannot post new polls. You cannot post replies to polls. You cannot edit your own topics. You cannot delete your own topics. You cannot edit other topics. You cannot delete other topics. You cannot edit your own posts. You cannot edit other posts. You cannot delete your own posts. You cannot delete other posts. You cannot post events. You cannot edit your own events. You cannot edit other events. You cannot delete your own events. You cannot delete other events. You cannot send private messages. You cannot send em
IP isWhoisCalculatorTool PointsNewsNews tip?ForumsAll ForumsHot TopicsGalleryInfoHardwareAll FAQsSite FAQDSL FAQCable TechAboutcontactabout uscommunityISP FAQAdd ISPISP Ind. ForumsJoin Search similar:Help can not removeFrequent line resyncs with NVG510[Virus] 100% cpu usage when browsing[Malware] Persistent bugStrange Music Web Browsing[Spyware] InfoAtoms? Forums → Software and Operating Systems → No, I Will Not Fix Your #@$!! Computer → [Windows] This guy needs a little SQL DB help ---> uniqs1443 Share « [Critical] iOS Google Authenticator update - DO NOT UPDATE • [Virtual] DL360 G5 USB boot » exocet_cmPirates?Premium Memberjoin:2003-03-23Virginiakudos:33 edits exocet_cm Premium Member 2013-Sep-5 9:32 pm [Windows] This guy needs a little SQL DB help --->Error logs on a SQL Server system:09/05/2013 20:00:00,,Error,[298] SQLServer Error: 4060 Cannot open database "vCenter_Server" requested by the login. The login failed. [SQLSTATE 42000]09/05/2013 20:00:00,,Error,[298] SQLServer Error: 18456 Login failed for user 'JOHNDBALL\SQLSVC'. [SQLSTATE 28000]SQLSVC is a special domain account used for running SQL services on DB systems. Working on all the other systems.I'm not a DB guy, so the bear with me. "Login failed" is referring to a DB that doesn't exist and hasn't existed in a while. The DB that took it's place is vCenter_Server_2. · actions · 2013-Sep-5 9:32 pm · SimbaTLK1Rawrrrjoin:2001-09-07Pittsburgh, PA SimbaTLK1 Member 2013-Sep-5 9:47 pm Is there still an (old) vCenter instance trying to connect to the old DB? · actions · 2013-Sep-5 9:47 pm · exocet_cmPirates?Premium Memberjoin:2003-03-23Virginiakudos:3 exocet_cm Premium Member 2013-Sep-5 10:00 pm No, it was blown away (not uninstalled, entire VM deleted and recreated). I'm not sure what is trying to access the old DB.Any way to tell what is trying to connect? · actions · 2013-Sep-5 10:00 pm · fryerjoin:2003-11-13Chadds Ford, PAkudos:2 fryer to exocet_cm Member 2013-Sep-6 10:51 am to exocet_cmNot a lot of info to run on, but my guess would be is that there is a job being kicked off at 8pm by sqlagent running under the SQLSVC account that still references the old database.I'd start by using the timeframe of