起初在遇到这个问题时,当然知道是怎么回事,但因为是新手,也不知道怎么处理...

百度了下,发现网上很多攻城狮们都是在mysql的命令行界面处理。

先输入命令:show variables like '%time_zone%';             查看数据库中的系统时区

在输入: set  global time_zone='+8:00';                            将系统时区切换到北京

以上方法是挺有效,但是当你重启本期服务器之后,可能又会犯错。

这里建议一种新的方式解决该错误:

在你的maven项目中,打开application.properties文件(application.yml差不多,但是两者规范有区别),将链接数据源的url多设置一下连接参数serverTimezone

比如: spring.datasource.url=jdbc:mysql://localhost:3306/springtest?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC

关于springboot连接数据库失败时,系统报错 MySQL:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents .....的更多相关文章

  1. JDBC/Mybatis连接数据库报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

    造成这个的原因是maven导入MyBatis的时候会自动导入最新版本的8.0.11,然后8.0.11采用了新驱动,之前版本会报错. 当我们使用高版本的MySQL驱动时可以在获取数据库的连接getCon ...

  2. JDBC报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

    报错原因:查阅资料发现这都是因为安装mysql的时候时区设置的不正确 mysql默认的是美国的时区,而我们中国大陆要比他们迟8小时,采用+8:00格式 解决方法: 1.修改MySQL的配置文件,MyS ...

  3. SpringBoot报错:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

    解决方法: 在数据库连接url配置后边加&serverTimezone=GMT%2B8 例: jdbc:mysql://127.0.0.1:3306/test改为jdbc:mysql://12 ...

  4. JDBC连接数据库报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. ......

    问题:Java程序使用JDBC连接MySQL数据库时,控制台报错如下: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' ...

  5. 解决MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents .....

    1.前言 今天在用SpringBoot2.0+MyBatis+MySQL搭建项目开发环境的时候启动项目发现报了一个很奇怪的错,报错内容如下: java.sql.SQLException: The se ...

  6. 连接mysql报错 : The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone...

    time zone 时区错误 DBEAVER连接MySQL运行报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or repres ...

  7. mysql报错:java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.

    mybatis链接mysql,启动服务报错: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecogni ...

  8. 【问题解决:时区】连接MySQL时错误The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone

    问题描述: MySQL升级到8.0.11之后连接数据库报错: Your login attempt was not successful, try again. Reason: Could not g ...

  9. springboot工程启动时,报错:No bean named 'shiroFilter' available

    在启动Springboot项目时,报错:org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ' ...

随机推荐

  1. Android之ScrollView嵌套ListView冲突 (listView只显示一行)

    在ScrollView中嵌套使用ListView,ListView只会显示一行多一点.两者进行嵌套,即会发生冲突.由于ListView本身都继承于ScrollView,一旦在ScrollView中嵌套 ...

  2. BOS只读状态修改

    update T_META_OBJECTTYPE set FSUPPLIERNAME ='PAEZ',FPACKAGEID =null

  3. Python3.7+Pycharm+cuda10.0+tensorflow GPU版本 安装

    处理器:I5-7500 显卡   :GTX1050Ti 系统   :Win10 1. 首先搭建Python环境. 官网https://www.python.org/downloads/下载Python ...

  4. 使用node.js实现apache功能

    1.先实现在url中输入文件路径能展示对应文件内容功能 const http = require('http') const fs = require('fs') const server = htt ...

  5. centos tomcat解压版安装

    解压: tar -xzvf apache-tomcat-8.5.23.tar.gz -C /usr/local/java 配置Tomcat的环境变量: export CATALINA_HOME=/us ...

  6. tp 框架 文本编辑器 不解析HTML标签

    解析 文本编辑器  空格 {$vo.content|htmlspecialchars_decode|stripslashes|html_entity_decode}

  7. Mysql连接字符,字段函数concat()

    Mysql连接字符,字段函数concat() 可将多个字符串或字段连接,多个参数以逗号隔开 select concat('现在是:',new_date) from work

  8. 洛谷P1808 单词分类_NOI导刊2011提高(01) 字符串排序

    洛谷P1808 单词分类_NOI导刊2011提高(01) 题目描述 Oliver为了学好英语决定苦背单词,但很快他发现要直接记住杂乱无章的单词非常困难,他决定对单词进行分类. 两个单词可以分为一类当且 ...

  9. Qt文件发布

    1.打开Qt文件夹下的,其他版本可能为Qt (版本号)for Desktop cmd 2.将Release文件下的exe文件复制到别的文件夹,我这里为G:\Qt\QT_project\ff 3.在Qt ...

  10. Java代码操作Elasticsearch

    创建maven项目,导入依赖 <dependency> <groupId>junit</groupId> <artifactId>junit</a ...