代码之家  ›  专栏  ›  技术社区  ›  JHBonarius

数据库资源管理器没有看到MySQL J Connect“无法在MATLAB Java类路径上找到JDBC驱动程序文件”

  •  2
  • JHBonarius  · 技术社区  · 6 年前

    我正在运行matlabr2018a,并试图使用数据库工具箱将其连接到MySQL 8.0.11服务器。我在用 this page as a guide .

    javaclasspath 给我:

        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>
    

    然后我试着 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
    

    看来一切都很好。以及:

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

    也能正常工作。

    如果我试图使用MATLAB的($400/年)数据库工具箱连接到数据库,我会得到“Unable to find JDBC driver file on MATLAB Java class path” enter image description here

    是我做错了什么,还是这是个虫子?有人知道怎么解决这个问题吗?

    根据 this answer

    1 回复  |  直到 4 年前
        1
  •  0
  •   JHBonarius    6 年前

    嗯,这确实是个虫子。

    Connection successful!