数据库 常见问题

  • 1:
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.
  • 2:
This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The


Mysql6.0连接中的几个问题


user=root  
password=  
#old driver   
#driverClass=com.mysql.jdbc.Driver  
#new driver is as follow:  
driverClass=com.mysql.cj.jdbc.Driver  
jdbcUrl=jdbc:mysql://localhost:3306/spring?serverTimezone=UTC  
  • 3: 高版本问题

version >5.7.0
已经开始区分大小写了

  • 4 :连接问题

maven 坐标
<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>6.0.4</version>
</dependency>

### MySQL Connector/J 5.x   (旧版连接)
#jdbc.url=jdbc:mysql://127.0.0.1:3306/test?useUnicode=true&characterEncoding=utf8

### MySQL Connector/J 6.x   (新版连接)
jdbc.url=jdbc:mysql:///test?serverTimezone=UTC&characterEncoding=utf8&useUnicode=true&useSSL=false
  • 5: 驱动问题
### MySQL Connector/J 5.x   (旧版驱动)
#jdbc.driver_class=com.mysql.jdbc.Driver

### MySQL Connector/J 6.x   (新版驱动)
jdbc.driver_class=com.mysql.cj.jdbc.Driver
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,399评论 19 139
  • 通过此文档对Mysql数据库及IBATIS使用过程中的常见问题和优化方式进行简单提示性描述,指导研发人员正确的设计...
    baiynistx阅读 3,878评论 1 1
  • 春秋碧月江樽梦, 古道清云醉华声。 落鸿天水冷接风, 一任江河我自乘。
    一揽芳华synh阅读 1,066评论 0 2
  • 有时候,我们明明已经有了一些想法,然而做决定的时候刚好相反,或者远远偏离初衷,这样的决定很多时候容易出错,...
    小鱼秧阅读 1,085评论 2 4
  • 今天回家了,其实每次回家要做三个多小时的车还真是痛苦,可是,对于家,还是那么的想回,自己现在越来越想活出自己的样...
    水墨丹青雪阅读 1,007评论 1 2