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 ...
随机推荐
- Ubuntu系统---C++之Eclipse 开始工程项目
Ubuntu系统---C++之Eclipse 开始工程项目 安装完Eclipse,那就像其它项目一样,先要测试一下是否能用. 一.测一个hello world例子二.利用OpenCV测试一个显示图片的 ...
- B进制星球(多进制 高精加)
https://www.luogu.org/problemnew/show/P1604 B(2<=B<=36)进制计数.编写实现B进制加法的程序. 输入输出格式 输入格式: 共3行第1行: ...
- PL/SQL查询,字段名添加中文别名,查询结果的字段名会显示问号,处理方法:
一开始查询出来的字段名显示的是???,下面说说解决方法(本人也是在网上看到的,算是重复编辑一下): -------------------------------------------------- ...
- 反射基础 System.Reflection
一.获取程序集Assembly 1.获取当前运行的程序集 System.Reflection.Assembly[] asm = AppDomain.CurrentDomain.GetAssemblie ...
- Educational Codeforces Round 74 (Rated for Div. 2) B. Kill 'Em All
链接: https://codeforces.com/contest/1238/problem/B 题意: Ivan plays an old action game called Heretic. ...
- [Google Guava] 10-散列
原文链接 译文链接 译者:沈义扬 概述 Java内建的散列码[hash code]概念被限制为32位,并且没有分离散列算法和它们所作用的数据,因此很难用备选算法进行替换.此外,使用Java内建方法实现 ...
- Python3发送webservice请求
Python3使用suds-jurko库来发送webservice接口请求 导入请求webservice接口需要用到的包 pip install suds-jurko 第一步:导入所需要的包 from ...
- ES6-3 变量的解构赋值
1.数组的解构赋值 数组的解构赋值其实是=左右进行“模式匹配”. ❗️❗️❗️=右侧是具体的数值,不是变量!,=左侧的是变量!如果右侧是变量形式,需要先计算出具体的数值!! let [a,[b],c] ...
- 微信小程序之 map 地图使用
1.在app.json中与pages平级的位置处,加上: "permission": { "scope.userLocation": { "desc& ...
- webservice三要素
1. 2. 3.