zoukankan      html  css  js  c++  java
  • 连接mysql时出现的异常信息:(com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';allowMultiQueries=true')

    连接mysql库报的异常信息:java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';allowMultiQueries=true'.

    解决方案:

    连接的mysql是8.0.11版本,首先更新mysql驱动到对应版本

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.11</version>
    </dependency>
    //原来的URL
    private static final String JDBC_URL = "jdbc:mysql://127.0.0.1:3306/db_ext_test?characterEncoding=UTF-8&amp;allowMultiQueries=true";
    
    //改后的URL:
    //    指定时区:serverTimezone=GMT
    //    指定是否用ssl连接:useSSL=false
    private static final String JDBC_URL1 = "jdbc:mysql://127.0.0.1:3306/db_ext_test?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=GMT";
  • 相关阅读:
    【python-plt】二元正态密度函数图像
    【python-plt】一元正态分布图像
    【7】极大似然估计与贝叶斯估计
    实变函数【1】集合
    图形学-心得
    分布式网络架构
    shader的内置变量
    图形学-绘制
    python加载图片
    linux下批量删除utf8 bom
  • 原文地址:https://www.cnblogs.com/zltao/p/11194702.html
Copyright © 2011-2022 走看看