数据库资源管理器看不到MySQL J Connect“无法在MATLAB Java类路径上找到JDBC驱动程序文件". [英] Database Explorer not seeing MySQL J Connect "Unable to find JDBC driver file on MATLAB Java class path"

查看:223
本文介绍了数据库资源管理器看不到MySQL J Connect“无法在MATLAB Java类路径上找到JDBC驱动程序文件".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行MATLAB R2018a,并尝试使用数据库工具箱将其连接到我的MySQL 8.0.11服务器.我正在使用此页面作为指南.

I'm running MATLAB R2018a and are trying to connect it to my MySQL 8.0.11 server using the database toolbox. I'm using this page as a guide.

我已经使用MySQL安装程序安装了Connector J 8.0,并将文件添加到了类路径(如上所述).运行javaclasspath给我:

I've installed the Connector J 8.0 using the MySQL installer and added the file to the class path (as described). Runningjavaclasspath gives me:

    STATIC JAVA PATH

C:\Program Files\MATLAB\R2018a\java\patch                                                                 
[.. removed many files]
C:\Program Files\MATLAB\R2018a\java\jar\zh_CN\webintegration_res.jar                                      
C:\Program Files (x86)\MySQL\Connector J 8.0\mysql-connector-java-8.0.11.jar                              

    DYNAMIC JAVA PATH

    <empty>

所以这似乎是正确的. 然后,我尝试(如在此所述):

So it seems correct. Then I try (as described here):

d = com.mysql.cj.jdbc.Driver;
urlValid = d.acceptsURL('jdbc:mysql://localhost:3306/[*removed*]');
props = java.util.Properties;
props.put('user',[*removed*]); props.put('password',[*removed]*);
con = d.connect('jdbc:mysql://localhost:3306/[*removed*]',props)

它告诉我

Tue Aug 07 10:59:16 CEST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

con =

com.mysql.cj.jdbc.ConnectionImpl@ea27e34

一切似乎都很好.并且:

So that all seems good. And:

con2 = database('[*removed*]', '[*removed*]', '[*removed*]', 'com.mysql.cj.jdbc.Driver', 'jdbc:mysql://localhost:3306/[*removed*]')

也可以正常工作.

如果尝试使用MATLAB的($ 400/年)数据库工具箱连接到数据库,则会收到无法在MATLAB Java类路径上找到JDBC驱动程序文件"的信息.

If I try to connect to the database using the MATLAB's ($400/year) database toolbox, I get "Unable to find JDBC driver file on MATLAB Java class path"

我做错什么了吗,或者这是一个错误?有人知道如何解决这个问题吗?

Am I doing something wrong, or is this a bug? Does anyone know how to fix this?

根据此答案版本应兼容.

推荐答案

嗯,这确实是一个错误.

Hmm, this indeed seems to be a bug.

我刚刚注意到测试"按钮没有变灰,如您在问题图像中所见.输入数据库详细信息并将其推送后,我可以输入我的用户名和密码,并返回

I just noticed the "Test" button was not grayed-out, as you can see in the image in the question. After entering my database details and pushing it I could enter my user name and password, which returned

Connection successful!

然后通过保存它,关闭配置面板并使用"New Query"连接到数据库,现在我已成功连接到数据库.

Then by saving it, closing the configure panel and connecting to the database using "New Query", I'm now successfully connected to my database.

这篇关于数据库资源管理器看不到MySQL J Connect“无法在MATLAB Java类路径上找到JDBC驱动程序文件".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆