-1

Some background on the issue: Windows’ Safe Mode is an essential tool. On computers infected with malware or crashing because of buggy drivers, Safe Mode starts your PC with a minimal set of drivers and services. No third-party software or drivers get loaded, and even the built-in Windows stuff is limited to just what’s necessary. Safe Mode is a great way to remove problem-causing software—like malware—without that software getting in the way. It also provides an environment where you may find it easier to roll back drivers, and use certain troubleshooting tools.

My former Windows account was blocked in which I created another through safe mode.

Now when I try to login to SQL Server, I get this error:

Login failed for user (Microsoft SQL Server, error: 18456)

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Ramon
  • 9
  • 1
  • 1
  • 5
  • I use windows 7 – Ramon Aug 28 '18 at 14:59
  • From your question,it is not clear,what is safe mode..Any ways..1.) if you are locked out of SQL and have no other account,try this (https://sqlcommunity.com/hacking-sa-password-in-sql-server/) – TheGameiswar Aug 28 '18 at 15:00
  • further,this link contains complete list of error codes,see error code and state from your error message and see what is the issue :https://sqlblog.org/2020/07/28/troubleshooting-error-18456 – TheGameiswar Aug 28 '18 at 15:01
  • It is hard to say what you did, hence hard to say why this error occurred. For starters, look at this: https://stackoverflow.com/questions/20923015/login-to-microsoft-sql-server-error-18456 – Pm Duda Aug 28 '18 at 15:01
  • Also ,try pasting entire error message always – TheGameiswar Aug 28 '18 at 15:01
  • Windows’ Safe Mode is an essential tool. On computers infected with malware or crashing because of buggy drivers.Safe Mode starts your PC with a minimal set of drivers and services. No third-party software or drivers get loaded, and even the built-in Windows stuff is limited to just what’s necessary. Safe Mode is a great way to remove problem-causing software—like malware—without that software getting in the way. It also provides an environment where you may find it easier to roll back drivers, and use certain troubleshooting tools. – Ramon Aug 28 '18 at 15:04
  • Ok.Try seeing the above links to see,if you are able to correlate your error message with statuses in the link(https://sqlblog.org/2020/07/28/troubleshooting-error-18456) – TheGameiswar Aug 28 '18 at 15:05
  • Thanks @TheGameiswar, i beleive the problem is that my new windows account login has not been given right to sql server. How do i give my new windows account login access to sql server – Ramon Aug 28 '18 at 15:17
  • If you have access to sql server from any other account or any of your team member has access, you can ask them to do.Other wise, if your windows account is admin on the box where sql server is residing, you can follow first link – TheGameiswar Aug 28 '18 at 15:53
  • you're trying to connect using "SQL Server Authentication"? – CR241 Aug 28 '18 at 19:09

1 Answers1

0

I'm guessing that you are using windows authentication to login to your SQL Server instance. Since you installed your current instance with the other user account and trying to logging in with different one you get this error.

You have two options:

  1. Create another instance with current user account.

  2. Login to windows with your previous account, login to SQL server, change password for sa account and you can login from anywhere with sa user and password.

Loqman
  • 1,487
  • 1
  • 12
  • 24
  • Thanks@ Loqman. Yes i use windows authentication. 1. Can't create another instance because i am unable to connect. 2. Can't Login to previous account as it's blocked, i only managed to create the current one through safe mode. – Ramon Aug 28 '18 at 15:46
  • @Ramon What do you mean by it's blocked? Did you forget the password? Is it a domain account? – Loqman Aug 28 '18 at 17:23
  • Yes it s blocked . Not a domain account. I googled the cause and i learnt it could be my antivirus – Ramon Aug 30 '18 at 15:48
  • What is the error message when you try to login to windows? – Loqman Aug 31 '18 at 16:14