http://blog.sina.com.cn/s/blog_546a30270102weh2.htmlhtml
http://www.cnblogs.com/zerocc/p/3425431.htmlnode
經過命令行來啓動數據庫的話,sql
C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn>sqlservr.exe
2017-06-07 11:16:15.12 Server Microsoft SQL Server 2012 (SP1) - 11.0.3156.0 (X64)
May 4 2015 18:48:09
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.2 <X64> (Build 9200: )數據庫
2017-06-07 11:16:15.12 Server (c) Microsoft Corporation.
2017-06-07 11:16:15.12 Server All rights reserved.
2017-06-07 11:16:15.12 Server Server process ID is 21236.
2017-06-07 11:16:15.12 Server System Manufacturer: 'Dell Inc.', System Model: 'Latitude E5470'.
2017-06-07 11:16:15.12 Server Authentication mode is MIXED.
2017-06-07 11:16:15.12 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2017-06-07 11:16:15.13 Server The service account is 'ASNET\clu'. This is an informational message; no user action is required.
2017-06-07 11:16:15.13 Server Registry startup parameters:
-d C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\master.mdf
-e C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Log\ERRORLOG
-l C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2017-06-07 11:16:15.29 Server SQL Server detected 1 sockets with 4 cores per socket and 8 logical processors per socket, 8 total logical processors; using 8 logical processors based on SQL Server licensing. This is an informational message; no user action is required.
2017-06-07 11:16:15.29 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2017-06-07 11:16:15.29 Server Detected 16266 MB of RAM. This is an informational message; no user action is required.
2017-06-07 11:16:15.31 Server Using conventional memory in the memory manager.
2017-06-07 11:16:15.41 Server This instance of SQL Server last reported using a process ID of 27204 at 2017/6/7 11:14:29 (local) 2017/6/7 3:14:29 (UTC). This is an informational message only; no user action is required.
2017-06-07 11:16:15.41 Server Node configuration: node 0: CPU mask: 0x00000000000000ff:0 Active CPU mask: 0x00000000000000ff:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2017-06-07 11:16:15.42 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2017-06-07 11:16:15.44 Server Software Usage Metrics is disabled.
2017-06-07 11:16:15.44 spid4s Starting up database 'master'.
2017-06-07 11:16:15.53 Server CLR version v4.0.30319 loaded.
2017-06-07 11:16:15.56 Server Common language runtime (CLR) functionality initialized using CLR version v4.0.30319 from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\.
2017-06-07 11:16:15.69 spid4s Resource governor reconfiguration succeeded.
2017-06-07 11:16:15.69 spid4s SQL Server Audit is starting the audits. This is an informational message. No user action is required.
2017-06-07 11:16:15.70 spid4s SQL Server Audit has started the audits. This is an informational message. No user action is required.
2017-06-07 11:16:15.75 spid4s SQL Trace ID 1 was started by login "sa".
2017-06-07 11:16:15.75 spid4s Server name is 'WASYGSHA01-1020'. This is an informational message only. No user action is required.
2017-06-07 11:16:15.77 spid4s Failed to verify Authenticode signature on DLL 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\ftimport.dll'.
2017-06-07 11:16:15.78 spid16s Starting up database 'msdb'.
2017-06-07 11:16:15.78 spid17s Starting up database 'LISA5_RPS'.
2017-06-07 11:16:15.78 spid18s Starting up database 'LISA5_PRG_Rewind'.
2017-06-07 11:16:15.78 spid20s Starting up database 'LISA5_CMS_Rewind'.
2017-06-07 11:16:15.78 spid9s Starting up database 'mssqlsystemresource'.
2017-06-07 11:16:15.78 spid19s Starting up database 'Installer_Repository5'.
2017-06-07 11:16:15.78 spid22s Starting up database 'Installer_CMS_Master5'.
2017-06-07 11:16:15.78 spid21s Starting up database 'Installer_Program_Master5'.
2017-06-07 11:16:15.78 spid23s Starting up database 'd_lisa_Program_RDC1F47A8FA04CD9272'.
2017-06-07 11:16:15.80 spid13s A self-generated certificate was successfully loaded for encryption.
2017-06-07 11:16:15.80 spid24s Starting up database 'd_lisa_CMS_RDC1F47A8FA04CD9272'.
2017-06-07 11:16:15.80 spid25s Starting up database 'TW_LS_RPS'.
2017-06-07 11:16:15.80 spid26s Starting up database 'TW_LS_PRG_DHL4_Base'.
2017-06-07 11:16:15.85 spid27s Starting up database 'TW_LS_CMS_DHL4'.
2017-06-07 11:16:15.85 spid13s Server is listening on [ 'any' <ipv6> 1433].
2017-06-07 11:16:15.86 spid28s Starting up database 'TW_LS_PRG_DHL4'.
2017-06-07 11:16:15.87 spid13s Server is listening on [ 'any' <ipv4> 1433].
2017-06-07 11:16:15.87 spid9s The resource database build version is 11.00.3000. This is an informational message only. No user action is required.
2017-06-07 11:16:15.87 spid13s Server local connection provider is ready to accept connection on [ \\.\pipe\SQLLocal\MSSQLSERVER ].
2017-06-07 11:16:15.89 spid13s Server named pipe provider is ready to accept connection on [ \\.\pipe\sql\query ].
2017-06-07 11:16:15.91 Server Server is listening on [ ::1 <ipv6> 1434].
2017-06-07 11:16:15.91 Server Server is listening on [ 127.0.0.1 <ipv4> 1434].
2017-06-07 11:16:15.91 Server Dedicated admin connection support was established for listening locally on port 1434.
2017-06-07 11:16:15.93 spid13s SQL Server is now ready for client connections. This is an informational message; no user action is required.
2017-06-07 11:16:15.93 Server SQL Server is attempting to register a Service Principal Name (SPN) for the SQL Server service. Kerberos authentication will not be possible until a SPN is registered for the SQL Server service. This is an informational message. No user action is required.
2017-06-07 11:16:15.94 spid9s Starting up database 'model'.
2017-06-07 11:16:15.97 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/WASYGSHA01-1020.asnet.accorservices.net ] for the SQL Server service. Windows return code: 0x2098, state: 15. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
2017-06-07 11:16:15.98 Server The SQL Server Network Interface library could not register the Service Principal Name (SPN) [ MSSQLSvc/WASYGSHA01-1020.asnet.accorservices.net:1433 ] for the SQL Server service. Windows return code: 0x2098, state: 15. Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies and if the SPN has not been manually registered.
2017-06-07 11:16:16.01 spid9s Clearing tempdb database.
2017-06-07 11:16:16.45 spid9s Starting up database 'tempdb'.
2017-06-07 11:16:16.53 spid29s The Service Broker endpoint is in disabled or stopped state.
2017-06-07 11:16:16.53 spid29s The Database Mirroring endpoint is in disabled or stopped state.
2017-06-07 11:16:16.55 spid29s Service Broker manager has started.
2017-06-07 11:16:16.65 spid4s Recovery is complete. This is an informational message only. No user action is required.
2017-06-07 11:16:40.50 Logon Error: 18456, Severity: 14, State: 5.
2017-06-07 11:16:40.50 Logon Login failed for user 'ASNET\clu'. Reason: Could not find a login matching the name provided. [CLIENT: 127.0.0.1]windows
2017-06-07 11:20:29.80 Logon Error: 18456, Severity: 14, State: 5.
2017-06-07 11:20:29.80 Logon Login failed for user 'ASNET\clu'. Reason: Could not find a login matching the name provided. [CLIENT: 172.31.212.20]
2017-06-07 11:21:45.60 Server Using 'dbghelp.dll' version '4.0.5'
2017-06-07 11:23:15.55 Server ***Unable to get thread context for spid 0
2017-06-07 11:23:15.55 Server * *******************************************************************************
2017-06-07 11:23:15.55 Server *
2017-06-07 11:23:15.55 Server * BEGIN STACK DUMP:
2017-06-07 11:23:15.55 Server * 06/07/17 11:23:15 spid 14040
2017-06-07 11:23:15.55 Server *
2017-06-07 11:23:15.55 Server * Non-yielding Scheduler
2017-06-07 11:23:15.56 Server *
2017-06-07 11:23:15.56 Server * *******************************************************************************
2017-06-07 11:23:15.56 Server Stack Signature for the dump is 0x000000000000029A
2017-06-07 11:23:17.04 Server External dump process return code 0x20000001.
External dump process returned no errors.
2017-06-07 11:23:17.04 Server DoMiniDump () encountered error (0x80004005) - Unspecified errorsession
2017-06-07 11:23:17.04 Server Process 0:0:0 (0x511c) Worker 0x00000004784A0160 appears to be non-yielding on Scheduler 5. Thread creation time: 13141278975449. Approx Thread CPU Used: kernel 0 ms, user 0 ms. Process Utilization 0%. System Idle 95%. Interval: 70137 ms.app
https://www.isunshare.com/sql-server/fix-sql-server-failed-login-error.htmlcors
Failed to verify Authenticode signature on DLL 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Binn\ftimport.dll'.socket
Failure to register a SPN might cause integrated authentication to use NTLM instead of Kerberos.
最後發現是域帳號的問題致使的,電腦的sql server是前同事安裝的,可是安裝的時候,是用的他本身的域帳號。
個人域帳號嘗試登錄沒法識別的。
處理方法,用以前同事的域帳號登錄電腦,而後鏈接上數據庫。而後把本身的域帳號加入到logins中。
從數據庫刪除用戶的的時候,提示用戶已經登陸,不容許刪除
經過下面的查詢語句找到session編號
SELECT session_id
FROM sys.dm_exec_sessions
WHERE login_name = 'chuck'
而後強制結束session,其中67是我找到的編號
kill 67
=========================================
刪除用戶以後,從新建立用戶遇到的問題
在出問題的數據庫上執行這個命令
sp_change_users_login 'AUTO_FIX', 'chuck'
The row for user 'chuck' will be fixed by updating its login link to a login already in existence.
The number of orphaned users fixed by updating users was 1.
The number of orphaned users fixed by adding new logins and then updating users was 0.
屢次 執行直到出現
The number of orphaned users fixed by updating users was 0.
The number of orphaned users fixed by adding new logins and then updating users was 0.
我遇到的問題是,以前用的EntityFramework,添加數據庫,是以連接數據文件生成的。
連接數據庫後臺是由EF作的
<connectionStrings> <add name="SchoolDBEntities" connectionString="metadata=res://*/School.csdl|res://*/School.ssdl|res://*/School.msl;provider=System.Data.SqlClient;provider connection string="data source=LUJUNTAO\MSSQLSERVER2012;initial catalog=SchoolDB;persist security info=True;user id=sa;password=123456;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> </connectionStrings>
坑爹了,發現以前鏈接數據庫的時候,沒有用127.0.0.1,用的竟然是LUJUNTAO\MSSQLSERVER2012
備註:
在"127.0.0.1"附加的數據庫和在"用戶名\數據庫實例"附加的數據庫是不一致的
鏈接局域網中的數據庫(remote database),遇到上面的錯誤。緣由是本地配置的代理沒有bypass掉局域網的ip。而後還須要重啓一下機器
Server Name: .
Error Number: 18456
Severity: 14
State: 1
Line Number: 65536
State 1
Error information is not available. This state usually means you do not have permission to receive the error details. Contact your SQL Server administrator for more information.
最後發現是由於連錯了數據庫,
本地安裝了sql server 2008和sql server 2014,其中sql server 2008的鏈接是127.0.0.1,可是sql server 2014的鏈接應該是127.0.0.1\sql2014
用everything搜索,ssms.exe "C:\Program Files (x86)\Microsoft SQL Server\" 【ssms.exe是sql server management studio】
"C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\Ssms.exe"