{"id":3945,"date":"2023-05-30T17:51:14","date_gmt":"2023-05-30T16:51:14","guid":{"rendered":"https:\/\/www.dpscomputing.com\/blog\/?p=3945"},"modified":"2023-05-30T17:51:16","modified_gmt":"2023-05-30T16:51:16","slug":"mssqlserver_18456-login-failed-for-user-reason-an-attempt-to-login-using-sql-authentication-failed-server-is-configured-for-windows-authentication-only","status":"publish","type":"post","link":"https:\/\/www.dpscomputing.com\/blog\/2023\/05\/30\/mssqlserver_18456-login-failed-for-user-reason-an-attempt-to-login-using-sql-authentication-failed-server-is-configured-for-windows-authentication-only\/","title":{"rendered":"MSSQLSERVER_18456 &#8211; Login failed for user &#8221;. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only."},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"246\" data-attachment-id=\"2592\" data-permalink=\"https:\/\/www.dpscomputing.com\/blog\/2019\/08\/11\/sql-server-2014-issues-step-this-way\/sql-server-2014\/\" data-orig-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014.png\" data-orig-size=\"300,246\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"SQL-Server-2014\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014-300x246.png\" data-large-file=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014.png\" tabindex=\"0\" role=\"button\" src=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014.png\" alt=\"\" class=\"wp-image-2592\" srcset=\"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014.png 300w, https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014-150x123.png 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n<\/div>\n\n\n<p>SQL errors can be frustrating &#8211; and none more so than not beginning able to log in to the blasted thing!  Let&#8217;s take you through some steps on understanding what the problem is (beyond the basics of not being able to login!) and ways that you can fix it.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">So, what does the error even mean?<\/h2>\n\n\n\n<p>So the error message itself is something like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Login failed for user '&lt;UserName>'. Reason: An attempt to login using SQL authentication failed. Server is configured for Windows authentication only<\/code><\/pre>\n\n\n\n<p>Not terribly helpful, but not the worst error message either.  Essentially this error happens when you&#8217;re trying to login to your <a href=\"https:\/\/www.microsoft.com\/en-gb\/sql-server\" target=\"_blank\" rel=\"noreferrer noopener\">Microsoft based SQL server <\/a>using SQL authentication.  The only catch?  The server doesn&#8217;t allow it.  <\/p>\n\n\n\n<p>What the server does allow is for you to use your Windows authentication to also login to the SQL server.  Simple enough, right?<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The Solution<\/h2>\n\n\n\n<p>There&#8217;s two ways to approach this &#8211; either we reconfigure the server or use Windows authentication.  And reconfiguring the server might not be the best idea due to potential security implications &#8211; presumably the reason that Windows authentication was selected by the server administrators in the first place &#8211; for example, if 2FA is enabled on your Windows login.  <\/p>\n\n\n\n<p>But we&#8217;ll go through both to let you have a free choice.  <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Using Windows Authentication<\/h2>\n\n\n\n<p>&#8220;Give the SQL Server what it wants!&#8221; &#8211; or so someone could bellow out loud.  Well, it is the simplest of the solutions&#8230;<\/p>\n\n\n\n<p>If you have a Windows user account &#8211; which presumably you have otherwise how have you even made it anywhere near SQL server &#8211; and, crucially, you have permissions to be there (assigned to your account) you can follow this process:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open SQL Server Management Studio<\/li>\n\n\n\n<li>STOP!  Don&#8217;t put in your SQL credentials &#8211; instead choose the &#8216;Windows Authentication&#8217; option.  <\/li>\n\n\n\n<li>Enter your WINDOWS credentials for your account &#8211; NOT your SQL credentials.  <\/li>\n\n\n\n<li>Click the login button.  <\/li>\n<\/ol>\n\n\n\n<p>And voila!  You should be logged in?<\/p>\n\n\n\n<p>Not worked \/ desperate?  Check below!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Server (Re)-Configuration<\/h2>\n\n\n\n<p>So, desperate times call for desperate measures &#8211; let&#8217;s go!<\/p>\n\n\n\n<p>The one way for getting around needing to use Windows authentication to log on is, of course, to not require it to logon.  Leaving it entirely open is an option &#8211; but an unwise one.  <\/p>\n\n\n\n<p>Contact your sysadmin to login with their super-duper administrative privs &#8211; and yes, they will have to use Windows authentication.  The from with SQL Server Management Studio they will be able to:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Right click on the server that your trying to access (let them know which one).  <\/li>\n\n\n\n<li>Select &#8216;Properties&#8217; from the menu.  <\/li>\n\n\n\n<li>Go to the &#8216;Security&#8217; tab.  <\/li>\n\n\n\n<li>Choose &#8216;SQL Server and Windows Authentication mode&#8217; (this will allow either\/or)<\/li>\n\n\n\n<li>Press &#8216;OK&#8217; to save changes.  <\/li>\n\n\n\n<li>Let you know you can retry with your SQL username and password.  <\/li>\n<\/ol>\n\n\n\n<p>Depending on how much they know and how much they like their job &#8211; they may or may not do this for you! \ud83d\ude42<\/p>\n\n\n\n<p>Happy SQLing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SQL errors can be frustrating &#8211; and none more so than not beginning able to log in to the blasted thing! Let&#8217;s take you through some steps on understanding what the problem is (beyond&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2592,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[55,2138,2139,29],"tags":[4412,4408,4407,4411,4405,4413,4406,4414,4410,4409],"class_list":["post-3945","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","category-development","category-development-issues","category-tutorials","tag-an-attempt-to-login-using-sql-authentication-failed","tag-fix-mssqlserver_18456","tag-fix-sql-server-error","tag-login-failed-for-user","tag-mssqlserver_18456","tag-server-is-configured-for-windows-authentication-only","tag-sql-server-errors","tag-sql-server-tutorials","tag-sql-server-windows-authentication","tag-unable-to-login-to-sql-server"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.dpscomputing.com\/blog\/wp-content\/uploads\/2019\/08\/SQL-Server-2014.png","jetpack_shortlink":"https:\/\/wp.me\/p3nsfA-11D","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/3945","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/comments?post=3945"}],"version-history":[{"count":1,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/3945\/revisions"}],"predecessor-version":[{"id":3946,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/posts\/3945\/revisions\/3946"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media\/2592"}],"wp:attachment":[{"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/media?parent=3945"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/categories?post=3945"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dpscomputing.com\/blog\/wp-json\/wp\/v2\/tags?post=3945"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}