Ошибка 18456 серьезность 14 состояние 8 sql server

I’m getting error 18456 from SQL Server Management Studio when I try to connect Windows Authentication or SQL Server Authentication as in the pictures below.

Windows Authentication
enter image description here

SQL Server Authentication
enter image description here

I want to implement the solution in this link: Login to Microsoft SQL Server Error: 18456 but I can’t start the engine in no way. Also, I don’t know my password for SQL Server Authentication.

What can I do?

Super Kai - Kazuya Ito's user avatar

asked Dec 29, 2016 at 20:11

alkokura49's user avatar

4

I have seen this problem very often with SQL Server 2012 and later versions (usually with new installations) the reason is SQL Server 2012 and later version do not give window Administrators automatically the admin rights in SQL Server.

This will leave you with no access to the SQL Server at all, in this case I use the following approach:

  1. Run SQL Server configuration Manager.

    Location for SQL Server configuration Manager:

SQL Server 2019    C:\Windows\SysWOW64\SQLServerManager15.msc
SQL Server 2017    C:\Windows\SysWOW64\SQLServerManager14.msc
SQL Server 2016    C:\Windows\SysWOW64\SQLServerManager13.msc
SQL Server 2014    C:\Windows\SysWOW64\SQLServerManager12.msc
SQL Server 2012    C:\Windows\SysWOW64\SQLServerManager11.msc
SQL Server 2008    C:\Windows\SysWOW64\SQLServerManager10.msc
  1. Right-Click the SQL Server Service and go to Properties.
  2. Go to Startup Parameters tab and add -m parameter there. This will cause the SQL-Server to run in Single-User mode.
  3. Restart the SQL Server service, make sure the SQL Server agent doesn’t start, if it does start it may obtain the single available connection to the SQL Server.
  4. Once the SQL Server Service has restarted successfully, Right-Click SSMS and Run as Administrator.
  5. At this point SQL Server would let you connect to SQL Server as Administrator, add your domain account to SQL Server assign SysAdmin role.
  6. Close the Management Studio, go back to the SQL Server configuration Manager remove -m from the startup parameters. Restart the SQL Server service and tadaaa.

Also do not do this on a server that is being used by others.

answered Dec 29, 2016 at 20:35

M.Ali's user avatar

M.AliM.Ali

68k13 gold badges101 silver badges127 bronze badges

2

I got the same error:

enter image description here

  1. When logging in with the default user «sa» and the wrong password.

  2. When logging in with the default user «sa» without restarting MSSQL(SQL Server) after changing «Server authentication» from «Windows Authentication mode» to «SQL Server and Windows Authentication mode».

The solution for «1» is changing the password for «sa» whether or not you forgot the password or don’t know the default password for «sa». *You can log in with «sa» and Empty password if you keep «Password:» and «Confirm password:» blank, then apply:

enter image description here

The solution for «2» is when changing «Server authentication» from «Windows Authentication mode» to «SQL Server and Windows Authentication mode»:

enter image description here

You will get this message below. So, as the message says, «Server authentication» is still «Windows Authentication mode» until restarting MSSQL with SQL Server Configuration Manager(SSCM):

enter image description here

Some of your configuration changes will not take effect until SQL Server is restarted.

So, you need to restart MSSQL with SQL Server Configuration Manager(SSCM) as shown below. This is How to find SQL Server Configuration Manager in your Windows Machine:

enter image description here

If you use these 2 solutions above, you will log in with the default user «sa» and the password.

sideshowbarker's user avatar

answered Aug 30, 2022 at 7:11

Super Kai - Kazuya Ito's user avatar

One option is to install a new instance of SQL Server and attach any databases to the new instance, but this can be tricky for a variety of reasons, especially if you do not have a recent backup of the master database.

Therefore, I’d suggest following the advice given by Microsoft here and start the instance in single-user mode, which will then allow any local administrator on the machine where the instance is installed to gain access and correct the authentication issues (resetting passwords etc.).

Of course, this presumes that you have access to a administrator account on the machine, which hopefully you do.

answered Dec 29, 2016 at 20:26

3N1GM4's user avatar

3N1GM43N1GM4

3,4703 gold badges19 silver badges40 bronze badges

Similar issue I faced and the solution mentioned on this post worked for me :
https://stackoverflow.com/a/23395581/4409488

What it basically says is that you have to change default login mode which is set to Windows authentication only to SQL Server and Windows Authentication mode.

Right click on the server => SelectProperties => Security page => Server authentication => Select SQL Server and Windows Authentication mode radio button

Restart the SQL server from Services. And you should be good to go.

answered Feb 26, 2019 at 4:48

Goel's user avatar

GoelGoel

831 silver badge8 bronze badges

2

Regarding a specific case of

Login failed for user 'sa'. Reason: Password did not match that for the login provided. [CLIENT: ##.##.##.##]

and its companion message

Error: 18456, Severity: 14, State: 8.

with respect to SQL Server 2014, Windows Server 2019, and SOLIDWORKS professional document management.

Summary

Test a different and less complex password.

Detail

My first successfully functioning credential contained 14 characters: letters upper & lower case, numbers, and symbols from this set «$!%^(){}[];:<>?». This enabled a SOLIDWORKS professional document management client stack to communicate with a remote SQL Server Express 2014 stack via the SA database account without the above error.

Searching on «SQL Server 2014 password restrictions» led to this helpful post
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/52eda46d-5814-45a0-b676-4676f0853474/invalid-password-symbols-for-sql-server-2014-login?forum=sqlsecurity

These links in the accepted answer—while not definitive for SQL Server 2014 nor for Windows Server 2019 credentials—did jog me out of my specific rut:

  • test a different credential
  • reduce complexity: try a 14 character instead of 48 character password; apply a more constrained symbol set

    http://technet.microsoft.com/en-us/library/cc786468%28v=ws.10%29.aspx
    http://technet.microsoft.com/en-us/library/cc756109(v=ws.10).aspx
    http://msdn.microsoft.com/en-us/library/ms722458(v=vs.85).aspx

TBD — replace above links with definitive links for

  • password specification documents for the SQL Server database family
  • password specification documents for the computer (local), workgroup, AD domains
  • documents elucidating specific alterations to passwords that policy can cause to occur in relevant authorization processing systems.

Server-side and client-side authorization stacks may not adhere to the same specifications and limitations. Detailed knowledge of both may be required to achieve functionality first, then some desired level of security.

May your enlightenment be swifter than mine, with fewer bruises.

answered Mar 3, 2020 at 7:24

David Fackler's user avatar

  1. login with windows authentication
  2. right click on server connection
  3. select properties
  4. select Security on left panel
  5. check SQL Server and Windows Authentication
  6. restart your sql server service
  7. enjoy … :-)
    enter image description here

answered Nov 16, 2020 at 3:49

Mang Jojot's user avatar

Mang JojotMang Jojot

3984 silver badges12 bronze badges

Above marked answer looks good but also for Troubleshooting Make sure username, password are correct.
Try running SSMS as administrator and logging in.
If using AD username with windows authentication then make sure account is not locked out.

If recently changed AD username password then try log off and log back in.

Please refer full article on sqlserver-dba.co.uk

answered Sep 1, 2021 at 10:54

vamshidhar reddy Bokka's user avatar

Search code, repositories, users, issues, pull requests…

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Содержание

  • 1 Определение источника ошибки авторизации SQL Server (18456 ошибка)
    • 1.1 Ошибка входа 18456
    • 1.2 Определение ошибки авторизации.

Недавно решил навести порядок в журнале подопечного SQL сервера. Большое количество записей состояло из ошибки 18456 — ошибка авторизации, причем в качестве источника стояла local system — что немного вводило в ступор. Вроде как кроме инстанса SQL сервера ничего больше на сервере не крутится.  В итоге выяснилось, что это был Report Server, которому была дадены необходимые права и журнал сервера стал горрраздо читабельнее )). В ходе писоков нашел мануал, котороый в принципе один мог бы почомчь разбораться в ситуации, если бы попался первым )http://www.eraofdata.com/blog/2009/01/. За это его перевод:


Определение источника ошибки авторизации SQL Server (18456 ошибка)

Всем нам периодически приходится определять источник ошибок авторизации  (login failures), и, заметив рост количества тем на форумах с просьбой о помощи в это вопросе, я решил начать новый год с поиска быстрого способа точного определения этих ошибок.   Я порыскал в интернете,в предположении, что эта тема была много раз обсосана и закрыта на других форумах или блогах, но с удивлением обнаружил, что хотя и есть много статей о том, что такое «ошибка авторизации» и что означают все коды, возвращаемые в сообщениях ошибки, я не смог найти пошагового описания того, что должен сделать DBA для определения откуда пришел запрос на авторизацию приведший к ошибке. Эта запись — моя попытка исключить этот пробел и показать как выделить процесс, вызывающий эту проблему.

Технология крайне не зависима от версий,  так что это не критично в каком пакете Вы это будете делать, но я предполагаю, что вы знаете как использовать SQL Server Profiler для трассировки запросов.

Ошибка входа 18456

Ошибка входа вызывает ошибку 18456 и сопровождается соответствующей записью в журнале SQL сервера (SQL Server 2000 не отображает IP адрес):

20090115 09:40:24.55 Logon Error: 18456, Severity: 14, State: 8.

20090115 09:40:24.55 Logon Login failed for user ‘Domain\User’. [CLIENT: xxx.xxx.xxx.xxx]

20090115 09:40:24.55 Logon Error: 18456, Severity: 14, State: 8.20090115 09:40:24.55 Logon Login failed for user ‘Domain\User’. [CLIENT: xxx.xxx.xxx.xxx]

Severity в логе указывает на серьезность ошибки. Severity: 14 означает, что ошибка может быть исправлена пользователем, что вполне логично для ошибок авторизации.
Следующее число указывает на номер состяния. Большинство ошибок имеют связанный с ними  номер  состояния , который обозначает дополнительную информацию обычно уникальную для каждой ошибки. Для ошибки авторизации состояние 8, показанное в приведенном выше примере, указывает что был использован некорректный пароль.

Следовательно, номер состояния предоставляет неоцинимую информацию  о причине ошибки авторизации и зачастую его достаточно для определения причины возникновения ошибки 18456.

В приведенной ниже таблице приведены расшифровки некоторых значений:

Состояние (State) Описание ошибки
1 Аккаунт заблокирован
2 ID пользователя не верно
5 ID пользователя не верно
7 Используемый логин отключен
8 Неверный пароль
9 Неподходящий пароль
11-12 Авторизация верная, но доступ к серверу невозможен
16 авторизация верная, но доступ к выбранной базе не разрешен
18 Истек срок действия пароля
27 Первоначальная база данных не найдена
38 Авторизация верная, на база данных не доступна( или нет разрешения)

Следующий пункт информации — логин (SQL сервера или Windows), сгененрировавший ошибку, затем IP адрес хоста, скоторго была предпринята попытка авторизации, который предоставляет полезную информацию для перекрестного поиска, для подтверждения что мы исследуем верный хост для выделения ошибки авторизации.

Определение ошибки авторизации.

Если информации, содержащейся в журнале ошибок не достаточно для определения источника ошибки, то следующей шаг это запустить трассировку SQL сервера для получения большего количества информации.
Наикратчайший путь для определения ошибок авторизации лежит через трассироку с помощью SQL Server Profiler (SSP).

Если Вы используете SQL Server 2005 или выше т у Вас до сих пор включен трассировщик по умолчанию (который включен по умолчанию в установке из коробки), тогда вам не нужна начинать новую трассировку. Проверьте вместо этого мою запись The SQL Server default trace.

Если у вас более ранняя версия SQL Serverm или же трассировка по умолчанию выключена (или же у вас проблемы с английским) — читайте дальше. (Нничего страшного не произойдет, если запустите еще один поток трассировки).

Запустите SSP, и, используя или ваш любимы шаблон трасировки, или же создав новый (File > Templates > New Templates…), убедитесь что выбраны следующие колонки:

ClientProcessID

Hostname

LoginName

NTUserName

NTDomainName

ApplicationName

Эти столбцы можно найти в диалоговом окне Trace Properties в закладке Events Selection. Если они не видны, поставте флажок «Show all columns». Обратите внимание, что столбе SPID выбран по умолчанию и не может быть убран.

В столбце Events выберите поле Audit Login в группе Security Audit. Так как мы заинтересованы только в ошибках авторизации, то это будет единственным выбранным событием, и мы будем уверенны что своим вмешательством мы создадаим минимальную нагрузку на систему. В «боевых» системах не желательно (ИМХО) запускать гафическую трассировку SSP на сервере, всегда желательно использовать трассировку на стороне сервера.

Нижеследующий рисунок показываает завршенный шаблон трассировки:

Шаблон поиска ошибки авторизации

Шаблон поиска ошибки авторизации

Это может выглядеть несколько уныло, но мы заинтересованы только в поиске конкретной ошибки.

Шаг 1

Сохраните измененный шаблон трассировки и запустите новую трассировку, определив сохраненный шаблон в качестве шаблона для новой трассировки и ждите появления ошибки авторизации. Остановите трассировку после появления ошибки авторизации.

Шаг 2

Столбец Hostname должен содержать запись имени сервера на котором произошел неверный логин, и ClientProcessID должен содержать идентификатор проблемного процесса (PID) (или процессов, если есть несколько связанных процессов).

Шаг 3

Заходим на сервер, на которм произошла ошибка и просматриваем подходящие процессы с помощью диспетчера задач (Task Manager). Для просмотра PID с помощью диспетчера задач, запустите этот диспетчер (Shift+Ctrl+Esc), идем в пунтк View->Select Columns… и выбираем флажок PID (Process Identifier) и нажимаем Ok.

Нажимаем на вкладку Processes для просмотра процессов, запущенных на сервере (убедитесь что стоит флажок Show all processes from all users) и нажмите на заголовок колонки PID, для сортировки по убыванию или возрастанию.

Шаг 4

После того, как Вы определите проесс по его PID, остается всего-лишь вопрос определения где процесс хранит настройки авторизации SQL сервера и проверить их Обычно, это процесс является сервисом, так что это вопрос всего0лишь вопрос запуска оснастки Services через Панель управления, или Start->Run-> services.msc

Так что, счастливой охоты!

Getting “Login failed for user (Microsoft SQL Server, error 18456)” error is a nightmare for the DBA’s and developers while working on the SQL Server Database. The error code indicates a failed login attempt which may be occurred due to several reasons. Though, the foremost reason for getting such Microsoft SQL Server error code 18456 could be a wrong password entry.

sql 18456

However, in many cases, an error code comes up with a description that helps users to get a clear picture of the error. But as you can see in the screenshot above, it doesn’t define the exact reason for getting the SQL Server error 18456. Though, in order to get the detailed information about the Microsoft SQL Server error code 18456, a Database administrator can check the event log.

Here in this article, I am trying to explain to you all the possible solutions to fix “Login Failed for user (Microsoft SQL Server, error 18456)” error.

Why SQL Server login failed for user error 18456 occurs?

SQL Server login failed for user error can occur due to any of the following reason:

  • Invalid credentials when logging into SQL Server
  • Enabling wrong authentication mode
  • Password expired of the existing user account
  • Disable username on the Server

States of SQL Server Error 18456

State

Description

1

Authentication failure

2 and 5

Incorrect or invalid userid. (Error: 18456, Severity: 14, State: 5.)

6

Try to login with Windows but specifying as a SQL Server account. (Error: 18456, Severity: 14, State: 6.)

7

Login disabled. (Error: 18456, Severity: 14, State: 7.)

8

Password incorrect. (Error: 18456, Severity: 14, State: 8.)

9

Invalid password

11 and 12

Valid login credentials but server access failed. (Error: 18456, Severity: 14, State: 11.)

Workaround to resolve Microsoft SQL Server error code 18456

Before going through the procedure, make sure that the credentials used for login the SQL Server should be valid. Follow the below steps to enable “SQL Server Authentication” to log in through it.

  • Launch Microsoft SQL Server Management Studio.
  • Do right-click on SQL Server under Object Explorer, and go to Properties.
  • In the Server Properties dialogue box, click on Security tab.
  • Under Server authentication, opt for the SQL Server and Windows Authentication mode.
  • Here you need to expand Security -> Logins and right-click on the server name and select Properties.
  • Now in the Login properties dialogue box, pass the password details (using SQL Authentication).
  • Finally, move to the Status tab, and select Enabled under login and click OK and restart the SQL Server.

Note: If you want Windows Authentication instead of SQL Server Authentication option, it is required to have admin rights to the user to attempt successful login. To do so, follow the below-mentioned steps:

  • Launch SQL Server, and log in as an SQL administrator.
  • Move to the Server where the user account exists and click to Plus (+) sign to expand the Logins.
  • Right-click on the account that you want to log in as Windows Authentication, and click New Login.
  • Now in the Login – New dialogue box window, click Search and type username which you have selected in the Logins folder, and click on Check Names button.
  • Here in the Login-New window, move to Server Roles and check sysadmin.
  • Finally, go to the Securables tab to verify the role addition.

You can perform any of the above-mentioned methods to fix the “Login Failed for user (Microsoft SQL Server, error 18456)”. However, if you still unable to fix it, you can opt for a professional SQL Database Recovery tool.

download

You can also use any of the below search term to find the solution to resolve Microsoft SQL Server error code 18456:

Microsoft SQL server error 18456 windows authentication

Microsoft SQL server error 18456 SQL server authentication

login failed for user ‘<user_name>’. (Microsoft SQL Server, error: 18456)

SQL server login failed for user 18456

Login failed for user ‘sa’ in SQL server 2008 r2

Related Post

Понравилась статья? Поделить с друзьями:
  • Ошибка 18456 sql server при подключении
  • Ошибка 1825 msg
  • Ошибка 18456 sql 2014
  • Ошибка 1824 sql
  • Ошибка 18265 шкода фабия