mysql关于时区报错问题The server time zone value ‘�й���׼ʱ��‘ is unrecognized

mysql关于时区报错问题The server time zone value ‘�й���׼ʱ��’ is unrecognized

会出现时区报错
spring.datasource.url=jdbc:mysql://localhost:3306/mybatis
不会出现时区报错
spring.datasource.url=jdbc:mysql://localhost:3306/mybatis?serverTimezone=UTC

ccess denied for user ‘root’@‘localhost’ (using password: YES)

提示密码错误! 修改mysql连接密码

Unknown database ‘[数据库名]’

数据库名错误

MySQL连接

jdbc:mysql://localhost:3306/[数据库名]?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://localhost:3306/[数据库名]?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: 用户名
password: 密码

MySQL5.x与mysql8连接差异

mysql8需要添加时区 如果中文乱码有问题需要添加utf-8编码 ,mysql5.x则不需要

猜你喜欢

转载自blog.csdn.net/ayunnuo/article/details/112742976