简体   繁体   English

SQL Server 2008连接问题

[英]SQL Server 2008 connection issues

So I'm working on a project using a SQL Server 2008 database. 因此,我正在使用SQL Server 2008数据库进行项目。 It uses Java with Hibernate. 它与Hibernate一起使用Java。 I was doing some work on it last week, it was working (relatively) fine. 上周我在做一些工作,(相对)很好。 I came back to it today and all of the sudden Hibernate can't login or connect to the database. 今天我回到了它,突然之间,Hibernate无法登录或连接到数据库。 I suspect the problem is in SQL Server because I tried connecting to it with JDBC but that didn't work either. 我怀疑问题出在SQL Server中,因为我尝试使用JDBC连接到它,但这也不起作用。

Server authentication is set to "SQL Server and Windows Authentication mode" 服务器身份验证设置为“ SQL Server和Windows身份验证模式”

my users "dummy" and "root" have "Grant" check on all explicit permissions. 我的用户“ dummy”和“ root”对所有显式权限都具有“ Grant”检查。

The username and password I enter are correct. 我输入的用户名和密码正确。 I know this because I can log in o SQL Server Management Studio with those logins and run queries. 我知道这一点是因为我可以使用这些登录名登录o SQL Server Management Studio并运行查询。

The database is on a Windows XP virtual machine and I'm using Eclipse on my host machine. 该数据库位于Windows XP虚拟机上,并且我在主机上使用Eclipse。 I have Port Forwarding and everything set up with Oracle VirtualBox (like I said, it was working fine last week). 我有端口转发功能,并且使用Oracle VirtualBox进行了所有设置(就像我说的那样,上周运行良好)。

Any suggestions? 有什么建议么?

--EDIT-- - 编辑 -
See the comments below the original post 请参阅原始帖子下方的评论

---EDIT--- - -编辑 - -
I made a discovery. 我发现了 My Java project is not even getting connected with the SQL Server. 我的Java项目甚至都没有与SQL Server建立连接。 When I fail a log in with a .udl test, a log message is created for the failed login. 当我无法通过.udl测试登录时,将为失败的登录创建一条日志消息。 But whenever I fail to login using my Java project on my host machine, there are logs created. 但是,每当我无法在主机上使用Java项目登录时,就会创建日志。
I should also point out that I can connect to a MySQL database running on the same VM and run queries on it just fine. 我还应该指出,我可以连接到在同一VM上运行的MySQL数据库并在其上运行查询。
Is there something wrong with this URL String? 这个网址字串有问题吗? "jdbc:sqlserver://192.168.56.1:1433;databaseName=MLB;user=dummy;password=123"
I can confirm that the IP Address, Port number, database name, username, and password are all correct. 我可以确认IP地址,端口号,数据库名称,用户名和密码都正确。

I figured out the answer myself. 我自己想出了答案。 I had install SQL Server 2014 on my host machine and somehow that conflicted with some settings somewhere. 我已经在主机上安装了SQL Server 2014,并且以某种方式与某处的某些设置冲突。 Once I unistalled SQL Server 2014 from my host machine all of my problems went away. 一旦从主机上解除SQL Server 2014的安装,我所有的问题都会消失。

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

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