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 ...
随机推荐
- Window脚本学习笔记之BAT调用设置
用一句bat脚本调用window的系统设置: rem 调用回收站 explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E} rem 检查Windows ...
- Vue-Cli3.0 单页面如何预渲染,解决登录拦截导致无法部分路由无法预渲染问题?
vue单页面不利于seo,如何解决已有spa项目seo问题? 1.安装 cnpm install prerender-spa-plugin --save-dev 2.路由history模式 const ...
- vscode远程修改文件('file': A system error occured )
The command you want is :e (short for :edit). If you use :edit! it will discard local changes and re ...
- SP15637 GNYR04H - Mr Youngs Picture Permutations[DP]
题目来源:POJ:http://poj.org/problem?id=2279 SPOJ:https://www.spoj.com/problems/GNYR04H/ 题意翻译 题目描述 杨先生希望为 ...
- 《流畅的Python》 A Pythonic Object--第9章
Python的数据模型data model, 用户可以创建自定义类型,并且运行起来像内建类型一样自然. 即不是靠继承,而是duck typing. 支持用内建函数来创建可选的对象表现形式.例如repr ...
- React中setState的怪异行为 ——setState没有即时生效
setState可以说是React中使用频率最高的一个函数了,我们都知道,React是通过管理状态来实现对组件的管理的,当this.setState()被调用的时候,React会重新调用render方 ...
- Java中的Listener 监听器
Listener的定义与作用 监听器Listener就是在application,session,request三个对象创建.销毁或者往其中添加修改删除属性时自动执行代码的功能组件. Listener ...
- easyUI-filebox图片上传和预览
转载自:https://blog.csdn.net/nvxiaq/article/details/77740516 备注: 1.如需上传多个图片可定义多个change_photo函数 在onChang ...
- 002_FreeRTOS临界段代码
(一)临界段代码也叫做临界区,是指那些必须完整运行,不能被打断的代码段 (二)FreeRTOS 与 临 界 段 代 码 保 护 有 关 的 函 数 有 4 个,两个是任务级的临界段代码保护,两个是中断 ...
- 002_linux之点灯(汇编深度解析)
1. 开发板采用韦山东的开发板 2. 芯片CPU三星S3C2440A 3. 控制引脚:GPF4 4. linux操作系统 5. 芯片手册下载地址:https://eyun.ba ...