SQL 如何修复错误:1069 - 由于登录失败,服务没有启动?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25619112/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I fix the error:1069 - The service did not start due to logon failure?
提问by gn12345
I have written my own windows service which interacts with a SQL database and updates it. The service was running fine and seems to be functioning correctly, however of late it seems to go down at random times and cannot restart due to the error designated in the question. I have tried various searches to fix this, but unfortunately I have come up with nothing. The aim is to eventually having this service running on my companies server, but I can't adjust any server settings, I am but a user on the server, so I have restrictions to some settings.
我编写了自己的 Windows 服务,它与 SQL 数据库交互并更新它。该服务运行良好并且似乎运行正常,但是最近它似乎在随机时间关闭并且由于问题中指定的错误而无法重新启动。我尝试了各种搜索来解决这个问题,但不幸的是我一无所获。目的是最终在我公司的服务器上运行此服务,但我无法调整任何服务器设置,我只是服务器上的用户,因此我对某些设置有限制。
Any quick fixes, would be helpful!
任何快速修复,都会有帮助!
回答by Mosca Pt
One issue for us was the format of the account user name, we initially used
我们的一个问题是帐户用户名的格式,我们最初使用
domain\username
域\用户名
and got the 1069-logon error, then ultimately I tried validating the user name in the properties | logon tab of the Service (in Control Panel / Service Manager), using the "Browse" and "Search" for the user name and it turned it suggested and validated ok with the reverse format
并得到 1069 登录错误,然后最终我尝试验证属性中的用户名 | 服务的登录选项卡(在控制面板/服务管理器中),使用“浏览”和“搜索”作为用户名,并使用反向格式将其建议和验证确定
username@domain
用户名@域
This also worked and resolved the 1069 error, and let us script the startup using sc.exe.
这也有效并解决了 1069 错误,让我们使用 sc.exe 编写启动脚本。
回答by Roberto Rodriguez
- Open the Services Manager. In case you dont know, do this by pressing CTRL + R, then type services.msc
- Then right click on the SQL Serverprocess and click Properties
- 打开服务管理器。如果您不知道,请按CTRL + R执行此操作,然后键入services.msc
- 然后右键单击SQL Server进程并单击属性
Then click Browse, and add your username in the box. (Notice it should contain the domain, in my case is AD\myusername), the Check Namesand accept.
- Finally type your password in the other two fields, and that's it, you should have permission to start your process now.
然后单击Browse,并在框中添加您的用户名。(注意它应该包含域,在我的例子中是 AD\myusername),检查名称并接受。
- 最后在其他两个字段中输入您的密码,就是这样,您现在应该有权开始您的流程。
Cheers!!
干杯!!
回答by binki
Error 1069 is vague and can have different causes. I am sharing my experience here.
错误 1069 含糊不清,可能有不同的原因。我在这里分享我的经验。
I encountered this error when trying to get a service to run under my account (I am trying to get my services to see the same LocalDB as interactive processes running on my account for development purposes). I use an MSA account with Windows's PIN loginnormally, so I rarely enter my Windows password. To resolve the issue, I locked my screen, selected Password input instead of PIN input, and then entered my password. I assume this somehow reminded Windows what my password was and made my local account more legit.
我在尝试让服务在我的帐户下运行时遇到此错误(为了开发目的,我试图让我的服务看到与在我的帐户上运行的交互式进程相同的 LocalDB)。我通常使用 Windows PIN 登录的MSA 帐户,所以我很少输入我的 Windows 密码。为了解决这个问题,我锁定了我的屏幕,选择了密码输入而不是 PIN 输入,然后输入了我的密码。我认为这以某种方式提醒了 Windows 我的密码是什么并使我的本地帐户更合法。
Before doing this, you need to configure the user account in question to have the Logon as Service privilege. To do this, open the Group Policy Editor. Expand Computer / Windows Configuration / Security Configuration / Local Policies / User Permissions Assignment and then open Login as Service. From there, you can add your user in question.
在执行此操作之前,您需要将相关用户帐户配置为具有作为服务登录权限。为此,请打开组策略编辑器。展开计算机/Windows 配置/安全配置/本地策略/用户权限分配,然后打开作为服务登录。从那里,您可以添加有问题的用户。
回答by campo
We had this issue as well because the account was set so that the password expired. After we updated the account to not expire and set the password this error stopped.
我们也遇到了这个问题,因为帐户设置为密码已过期。在我们将帐户更新为不过期并设置密码后,此错误停止了。
回答by varun
also check for "Deny Logon service" policy. user should not be added over there
还要检查“拒绝登录服务”策略。不应在那里添加用户