Spring Boot连接MySQL报错“Internal Server Error”的解决办法
报错信息如下:
{timestamp: "2018-06-14T03:48:23.436+0000", status: 500, error: "Internal Server Error",…}
error
:
"Internal Server Error"
message
:
"Could not open JDBC Connection for transaction; nested exception is java.sql.SQLException: 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."
path
:
"/user/userList"
status
:
500
timestamp
:
"2018-06-14T03:48:23.436+0000"
这个问题我之前在ubuntu上没有遇到,是在Windows上使用时出现了这个问题。
解决办法:
在spring.datasource.url对应的URL后面加?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
例:
spring.datasource.url=jdbc:mysql://localhost:3306/zifeiydb?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
完整的一个application.properties例子:
# DB Configuration
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://localhost:3306/zifeiydb?serverTimezone=UTC&useUnicode=true&characterEncoding=UTF-8
spring.datasource.username=root
spring.datasource.password=password
# logging
logging.level.com.zifeiy.demo=debug
Spring Boot连接MySQL报错“Internal Server Error”的解决办法的更多相关文章
- 连接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 ...
- flask开发遇到Internal Server Error的解决办法
flask开发过程中遇到了Internal Server Error错误,可以在代码加上debug app.debug=True 这样就能看到错误信息了
- Odoo8出现Internal Server Error的解决办法之一
转载地址:http://blog.sina.com.cn/s/blog_7cb52fa80102vaf3.html 问题: 不知怎么回事,我的Odoo8出错了,重装也一样出错信息如下 Inte ...
- Cobbler 登录web界面提示报错“Internal Server Error”解决办法
Cobbler登录web页面报错 查看httpd日志/etc/httpd/logs/ssl_error_log 查看cobbler的py配置文件 sed -n '38,41p' /usr/share/ ...
- 【玩转Ubuntu】08. Linux报错:Syntax error: "(" unexpected解决办法
问题: 在MAC上写了一段shell脚本,放到Ubuntu上运行总是报下面这个错误,单步调试都是对的,就是直接运行会报错. bixiaopeng@ubuntu:~/package$ sh packag ...
- 连接MySQL报错The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone.
MySQL time zone 时区错误 使用root用户登陆执行命令: ---> show variables like '%time_zone%'; 默认值system为美国时间:如下图: ...
- PHP7 上传文件报错 Internal Server Error 解决方法
打开Apache配置httpd.conf.在最后添加FcgidMaxRequestLen指令一个足够大的值(以字节为单位),例如 FcgidMaxRequestLen 100000000 最后重新启动 ...
- Navicat Premium 12连接MySQL时报错2059和1045的解决办法
参考连接:https://www.jianshu.com/p/15876ad165f5 https://jingyan.baidu.com/article/c275f6ba479ca9e33d7567 ...
- Linux 报错:syntax error "C" 解决办法(此处选择bash系统)
出现此问题的原因,是由系统的兼容性引起的,linux下默认了指向dash而非bash. linux下Dash改Bash: 1.先查看是使用哪个shell ls -al /bin/sh 2.#如果是Da ...
随机推荐
- 马的遍历(BFS
https://www.luogu.org/problemnew/show/P1443 模板BFS...... #include<iostream> #include<cstdio& ...
- 3.使用webpack配置文件webpack.confg.js配置打包文件的入口和出口
在项目根目录下新建webpack.config.js文件 webpack.config.js文件配置如下: // Node的路径操作使用的是path模块 const path=require('pat ...
- python_tkinter事件
1.事件绑定函数(3个) 组件.bind('事件类型',事件函数) 为一个组件绑定一个操作 组件.bind_class('组件类型','事件类型',事件函数) 为一个类组件绑定一个操作 组件.bind ...
- BackGroundWorker组件使用、Winform控件的Invoke安全调用
BackgroundWorker是·net里用来执行多线程任务的控件,它允许编程者在一个单独的线程上执行一些操作. 可以通过编程方式创建 BackgroundWorker,也可以将它从"工具 ...
- .net 后台页面统一验证是否登录
首先新写一个PageBase类 using System; using System.Collections.Generic; using System.Web; namespace Departme ...
- angularjs google map
google map display incorrect To remove the grayness, according to https://angular-ui.github.io/angul ...
- 内存泄露检测之mtrace
————————————————版权声明:本文为CSDN博主「知耻而后勇的蜗牛」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明.原文链接:https://blog ...
- BZOJ 3903 反垄断 (最大流推的结论题)
题目 中文题目,不解释: BZOJ传送门 分析 这道题BZOJ上也只有几个人过-奇怪了 下面是正解 原问题为一个二分图边染色问题.首先考虑最好情况.最理想情况的分配为:设一个点xxx的度为dgr(x) ...
- nginx配置及使用
偶尔会用到nginx部署项目,记录nginx配置备忘.主要有端口.地址及别名,代理转发和https配置. 配置文件为nginx.conf. 部署http项目: 1.找到http下的server配置项 ...
- 11、组件注册-使用FactoryBean注册组件
11.组件注册-使用FactoryBean注册组件 package org.springframework.beans.factory; import org.springframework.lang ...