简体   繁体   English

如何将Weka连接到MSSQL服务器

[英]How connect Weka to MSSQL server

I want to connect to MSSQL server in Weka 3.8 . 我想在Weka 3.8中连接到MSSQL服务器。 I tried lots of things and I couldn't find a way to connect to SQLServer 2012 Database . 我尝试了很多事情,但找不到连接SQLServer 2012数据库的方法

Error: driver not found. 错误: 找不到驱动程序。

I applied all steps about JDBC-ODBC bridge (link below) 我应用了有关JDBC-ODBC桥的所有步骤(下面的链接)

https://andersspur.wordpress.com/2013/10/11/connect-weka-to-sql-server-2012-and-14/ https://andersspur.wordpress.com/2013/10/11/connect-weka-to-sql-server-2012-and-14/

ErrorImage : ErrorImage: 在此处输入图片说明

I know it is late, but I had the same problem, and this took me a while to find the solution. 我知道已经晚了,但是我遇到了同样的问题,这花了我一段时间才能找到解决方案。 I am almost sure you found the solution. 我几乎可以肯定您找到了解决方案。 In here, it is the second step. 在这里,这是第二步。 However, I am sharing my approach and hope you and other find this helpful. 但是,我正在分享我的方法,并希望您和其他人对此有所帮助。

First, you need to download jdbc driver from Microsoft as you did. 首先,您需要像以前一样从Microsoft下载jdbc驱动程序。 For me: Here 对我来说: 这里

Second, make sure you have enabled TCP/IP connection. 其次,请确保已启用TCP / IP连接。 More info is here and here , 更多信息在这里这里

Third, enable Remote connection in SQL server instance, See here . 第三,在SQL Server实例中启用远程连接,请参见此处

Fourth, enable mix security mode in SQL, Here , You may need to restart the sql engine. 第四,在SQL中启用混合安全模式, 在这里 ,您可能需要重新启动sql引擎。 Integrated security may alos work for you. 集成安全性可能无法为您服务。 In this case, see how to set parameters here , Add a user and give it access to db you want. 在这种情况下,请在此处查看如何设置参数,添加用户并授予其访问所需数据库的权限。

Fifth, Follow these steps in here or here , as you mentioned. 第五,如前所述,按照此处此处的步骤进行操作。

Sixth, Press this button, 第六,按这个按钮 在此处输入图片说明 go to this address 'C:\\Program Files\\Weka-3-8\\weka\\experiment' and select 'DatabaseUtils.props', You should have edited this file in Fifth and this path may be different on your computer. 转到此地址'C:\\ Program Files \\ Weka-3-8 \\ weka \\ experiment'并选择'DatabaseUtils.props',您应该已经在Fifth中编辑了此文件,并且该路径在您的计算机上可能不同。

Updated You may need to copy the modified DatabaseUtils.props into wekafiles folder possibly located C:\\Users\\myUser\\wekafiles for Weka 3.8 as suggested by Ivan 已更新您可能需要将修改的DatabaseUtils.props复制到wekafiles文件夹中,该文件夹可能位于C:\\Users\\myUser\\wekafiles建议的Weka 3.8的C:\\Users\\myUser\\wekafiles

Seventh, Press this button and hope you can successfully connect to sql server. 第七,按此按钮,希望您可以成功连接到sql server。

在此处输入图片说明

This worked for me as shown here. 如图所示,这对我有用。 在此处输入图片说明

I installed JDBC Driver from msdn. 我从msdn安装了JDBC驱动程序。 But I couldn't find solution. 但是我找不到解决方案。 Also I looked for the solutions which are defined in link below. 我也在寻找下面链接中定义的解决方案。 Non of them is a problem in my case. 在我看来,这些都不是问题。

http://javarevisited.blogspot.com/2015/10/sql-server-jdbc-error-tcpip-connection-to-host-failed-port-1433.html http://javarevisited.blogspot.com/2015/10/sql-server-jdbc-error-tcpip-connection-to-host-failed-port-1433.html

Here ise the error: exception: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host WAREHOUSE, port 1433 has failed. 这是错误的错误:异常:com.microsoft.sqlserver.jdbc.SQLServerException:到主机WAREHOUSE端口1433的TCP / IP连接失败。 Error: "Connect timed out. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.". 错误:“连接超时。请验证连接属性。请确保SQL Server实例正在主机上运行并且在端口上接受TCP / IP连接。请确保与端口的TCP连接没有被防火墙阻止。 ”。

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

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