简体   繁体   English

无法连接到本地主机上的数据库 | SQL Server 2012 速成版

[英]Cannot connect to database on Localhost | SQL Server 2012 Express

I'm trying to connect to my database from a software of control access and attendance (named Crosschex from Anviz), which ask for the following data:我正在尝试从控制访问和考勤软件(来自 Anviz 的 Crosschex)连接到我的数据库,该软件要求提供以下数据:

-IP address, user, password, name of database -IP 地址、用户、密码、数据库名称

I'm using Localhost as IP address我使用 Localhost 作为 IP 地址

I'm unable to connect to it because it throws a message saying我无法连接到它,因为它会抛出一条消息说

IP address, user or pwd wrong. IP 地址、用户或密码错误。

I already created an instance, which is running.我已经创建了一个正在运行的实例。 If I connect to the instance through SSMS, it works fine.如果我通过 SSMS 连接到实例,它工作正常。 I created a user associated to the database I'm willing to connect.我创建了一个与我愿意连接的数据库相关联的用户。

From SQL configuration manager:从 SQL 配置管理器:

  • SQL Server is running as virtual service SQL Server 作为虚拟服务运行
  • SQL browser is running as local service SQL 浏览器作为本地服务运行
  • SQL server agent is running as network service SQL 服务器代理作为网络服务运行
  • SQL network configuration has named pipes enabled. SQL 网络配置已启用命名管道。 TCP/IP enabled , in IP addresses —>IPall I had set port 1433. I restarted all services after this. TCP/IP 已启用,在 IP 地址 —>IPall 我设置了端口 1433。此后我重新启动了所有服务。

The funny thing is I already did this in another VM with same config and it worked out, had to changed it because of collation I have chosen before was wrong for my application.有趣的是,我已经在另一个具有相同配置的 VM 中执行了此操作,并且成功了,由于我之前选择的排序规则对我的应用程序来说是错误的,因此不得不对其进行更改。 Is this somehow related to my app being unable to connect?这是否与我的应用程序无法连接有关? My collation is Modern-Spanish_CS_AS, and is the only thing I changed comparing to the old VM.我的排序规则是 Modern-Spanish_CS_AS,与旧 VM 相比,这是我唯一更改的内容。

Parameters of my System:我的系统参数:

  • Virtual machine on Virtualbox Virtualbox 上的虚拟机
  • Win10 Pro Win10 专业版
  • SQL 2012 Express SQL 2012 速成版
  • SQL Server Management Studio SQL Server 管理工作室
  • Software Crosschex软件 Crosschex

Edit编辑

I got these logs but I'm not sure what they mean我收到了这些日志,但我不确定它们是什么意思

11/17/2020 21:36:03,spid52,Unknown,Using 'xpstar.dll' version '2011.110.5058' to execute extended stored procedure 'xp_enumerrorlogs'. 11/17/2020 21:36:03,spid52,Unknown,使用“xpstar.dll”版本“2011.110.5058”执行扩展存储过程“xp_enumerrorlogs”。 This is an informational message only;这只是一条信息性消息; no user action is required.无需用户操作。

11/17/2020 21:36:03,spid52,Unknown,Attempting to load library 'xpstar.dll' into memory. 11/17/2020 21:36:03,spid52,未知,试图将库“xpstar.dll”加载到内存中。 This is an informational message only.这只是一条信息性消息。 No user action is required.无需用户操作。

11/17/2020 21:35:02,Logon,Unknown,Login failed for user 'anviz'. 11/17/2020 21:35:02,登录,未知,用户“anviz”登录失败。 Reason: Failed to open the explicitly specified database 'Master'.原因:无法打开明确指定的数据库“Master”。 [CLIENT: 127.0.0.1] [客户端:127.0.0.1]

11/17/2020 21:35:02,Logon,Unknown,Error: 18456 Severity: 14 State: 38. 11/17/2020 21:35:02,登录,未知,错误:18456 严重性:14 状态:38。

11/17/2020 21:33:34,Logon,Unknown,Login failed for user 'anviz'. 11/17/2020 21:33:34,登录,未知,用户“anviz”登录失败。 Reason: Failed to open the explicitly specified database 'Master'.原因:无法打开明确指定的数据库“Master”。 [CLIENT: 10.0.0.11] [客户端:10.0.0.11]

11/17/2020 21:33:34,Logon,Unknown,Error: 18456 Severity: 14 State: 38. 11/17/2020 21:33:34,登录,未知,错误:18456 严重性:14 状态:38。

sql user sql用户

crosschex交叉检查

sql network configuration sql网络配置

Your edit with the error logs tells you the error:您对错误日志的编辑会告诉您错误:

11/17/2020 21:35:02,Logon,Unknown, Login failed for user 'anviz'. 11/17/2020 21:35:02 ,登录,未知,用户“anviz”登录失败。 Reason: Failed to open the explicitly specified database 'Master'.原因:无法打开明确指定的数据库“Master”。 [CLIENT: 127.0.0.1] [客户端:127.0.0.1]

Will you please triple-check that your user account in SQL, anviz , has been access to the Master database?请三重检查您在 SQL 中的用户帐户anviz是否可以访问 Master 数据库? That's what your software is attempting to connect to.这就是您的软件试图连接的内容。 If you have granted access to the database[s], and you're still getting this error, let us know -- that'd be something tricky!如果您已授予对数据库 [s] 的访问权限,但仍然出现此错误,请告诉我们——这将是一件棘手的事情!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM