美女镇楼吃喝不愁
1.介绍项目相关性:
!-数据源-
Dependency
GroupIdcom.alibaba/groupId
工件ddruid/工件id
版本1.1.0/版本
/dependency
!-MySQL -
Dependency
GroupIdmysql/groupId
工件dmysql-连接器-Java/工件id
版本8.0.11/版本
/dependency
!-我的巴蒂斯-
Dependency
GroupIdorg.myba/groupId
工件dmybatis-spring-boot-starter/工件id
版本1.3.1/版本
/dependency
2.使用Alibaba Druid数据源配置数据源
Mysql connector/j5.x(旧式连接)
# spring . data source . URL=JDBC : MySQL ://127 . 0 . 0 . 1:3306/RWA?use unicode=truecharacter encoding=utf8
Mysql连接器/j6.x之后(新连接)
spring . data source . URL=JDBC : MySQL ://RWA?server time zone=utccharacterencoding=utf8 use unicode=true usessl=false
#说明:新驱动程序URL的默认地址为127.0.0.1:3306,因此本机MySQL数据库地址访问可以表示为///
# spring . data source . URL=JDBC : MySQL ://localhost :3306/RWA?server time zone=utccharacterencoding=utf8 use unicode=true usessl=false
#
注:基于MySQL的URL的新版本必须设置时区(serverTimezone=UTC)。否则,将报告以下错误:
Java . the server time zone value ' I' is unrecognized or represents more than one time zone . you must configure C driver(via the
Atcom.my (sqlerror.java :127)到[my]
Atcom.my (sqlerror.java :95)到[my]
Atcom.my (sqlerror.java :87)到[my]
Atcom.my (sqlerror.java :61)到[my]
Atcom.my (sqlerror.java :71)到[my]
atcom . my(sqlexceptionsmapping . Java :76)~[my]
atcom . my(connection impl . Java :862)~[my]
at com . my;init(connection impl . Java :444)到[my]
atcom . my(connection impl . Java :230)~[my]
atcom . my(nonregisteringdriver . Java :226)~[my]
atcom . Alibaba . druid .(filterchainimpl . Java :148)到[druid-1 . 1 . 0 . jar 33601 . 1;
atcom . aliba ba . druid .(stat filter . Java 3360217)到[druid-1.1.0.jar 33601.1.0]
atcom . Alibaba . druid .(filterchainimpl . Java :142)到[druid-1 . 1 . 0 . jar 33601 . 1;
atcom . aliba ba . druid .(druidabstractdatasource . Java :1466)到[druid-1 . 1 . 0 . jar 33601]
atcom . aliba ba . druid .(druidabstractdatasource . Java 33601529)到[druid-1 . 1 . 0 . jar 33601]
atcom . aliba ba . druid . $ crea(druid data source . Java 33602178)到[druid-1.1.0.jar 33601
' caused by : com . my : the server time zone value '的mi' is unrecognized or represents more than one time zone . ye He server or JDBC drire
at(Unknown Source)~[na 3360 na]
at(delegatingconstructoraccessorimpl . Java :45)到[na 33601 . 8 . 0 _ 91]
at Java . lang . re(constructor . Java :423)到[na :1.8.0 _ 91]
atcom . my(exception factory . Java :59)~[my]
atcom . my(exception factory . Java :83)~[my]
Atcom.my (timeutil.java :128)到[my]
atcom . my(native protocol . Java :2201)~[my]
atcom . my(native protocol . Java :225)~[my]
atcom . my(connection impl . Java :1391)~[my]
atcom . my(connection impl . Java :993)~[my]
atcom . my(connection impl . Java :852)~[my]
.9 common frames omitted
添加时区参数serverTimezone=UTC
项目正常启动!
————————————————
版权声明:本文请根据CSDN博主“Franmingos”的原创文章、CC 4.0 BY-SA版权合同,附上原文来源链接及本声明。
原文链接:
1.《「微服务」你会用SpringBoot+MyBatis连接Mysql8.0吗?》援引自互联网,旨在传递更多网络信息知识,仅代表作者本人观点,与本网站无关,侵删请联系页脚下方联系方式。
2.《「微服务」你会用SpringBoot+MyBatis连接Mysql8.0吗?》仅供读者参考,本网站未对该内容进行证实,对其原创性、真实性、完整性、及时性不作任何保证。
3.文章转载时请保留本站内容来源地址,https://www.lu-xu.com/gl/2252880.html