MySQL 异常:时区错误
1、时区错误
异常信息为:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
时区的错误,因此只要将时区设置为你当前系统时区即可
打开cmd执行命令登录MySQL
mysql -u root -p
执行命令:
show variables like '%time_zone%';
会出现
执行修改命令:
set global time_zone='+8:00';
或者直接将 url改为:
"jdbc:mysql://localhost:3306/shiro_test?serverTimezone=GMT%2B8"
执行退出命令:
exit
重新登录执行命令:
show variables like '%time_zone%';