报错信息如下:

{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”的解决办法的更多相关文章

  1. 连接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 ...

  2. flask开发遇到Internal Server Error的解决办法

    flask开发过程中遇到了Internal Server Error错误,可以在代码加上debug app.debug=True 这样就能看到错误信息了

  3. Odoo8出现Internal Server Error的解决办法之一

    转载地址:http://blog.sina.com.cn/s/blog_7cb52fa80102vaf3.html     问题: 不知怎么回事,我的Odoo8出错了,重装也一样出错信息如下 Inte ...

  4. Cobbler 登录web界面提示报错“Internal Server Error”解决办法

    Cobbler登录web页面报错 查看httpd日志/etc/httpd/logs/ssl_error_log 查看cobbler的py配置文件 sed -n '38,41p' /usr/share/ ...

  5. 【玩转Ubuntu】08. Linux报错:Syntax error: "(" unexpected解决办法

    问题: 在MAC上写了一段shell脚本,放到Ubuntu上运行总是报下面这个错误,单步调试都是对的,就是直接运行会报错. bixiaopeng@ubuntu:~/package$ sh packag ...

  6. 连接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为美国时间:如下图: ...

  7. PHP7 上传文件报错 Internal Server Error 解决方法

    打开Apache配置httpd.conf.在最后添加FcgidMaxRequestLen指令一个足够大的值(以字节为单位),例如 FcgidMaxRequestLen 100000000 最后重新启动 ...

  8. Navicat Premium 12连接MySQL时报错2059和1045的解决办法

    参考连接:https://www.jianshu.com/p/15876ad165f5 https://jingyan.baidu.com/article/c275f6ba479ca9e33d7567 ...

  9. Linux 报错:syntax error "C" 解决办法(此处选择bash系统)

    出现此问题的原因,是由系统的兼容性引起的,linux下默认了指向dash而非bash. linux下Dash改Bash: 1.先查看是使用哪个shell ls -al /bin/sh 2.#如果是Da ...

随机推荐

  1. 使用pyinstaller打包使用cx_Oracle模块的程序出现The specified module could not be found的问题

    pyinstaller看起来并不会将动态链接库自动打包,所以我们需要告诉pyinstaller要打包哪些动态链接库,步骤如下(假设python文件名为 oracletest.py): 1. 使用pyi ...

  2. Python基础之异常

    一.摘要 Python使用被称为异常 的特殊对象来管理程序执行期间发生的错误.每当发生让Python不知所措的错误时,它都会创建一个异常对象.如果你编写了处理该异常的代码,程序将继续运行:如果你未对异 ...

  3. Js获取字符串的显示宽度/高度

    重点:1.在H5页面,文字大小单位为rem2.不同的font-family,文字的宽度不一样3.文字宽度同时受font-size和font-family影响 思路:在页面动态创建一个节点,设置节点的f ...

  4. PHP 二维数组排序函数的应用 array_multisort()

    <?php $arrayData = array( array("name"=>"泰山", "age"=>"23 ...

  5. MySQL进阶8 分页查询(limit) - 【SQL查询语法执行顺序及大致结构】- 子查询的3个经典案例

    #进阶8 分页查询 /* 应用场景: 当要显示的数据,一页显示不全,需要分页提交sql请求 语法: select 查询列表 #7 from 表1 #执行顺序:#1 [join type join 表2 ...

  6. Nginx防盗链模块ngx_http_referer_module

    ngx_http_referer_module⽤用来阻⽌止Referer⾸首部⽆无有效值的请求访问,可防⽌止盗链指令:12.1 valid_referers定义 referer ⾸首部的合法可⽤用值, ...

  7. Java8-Lock-No.01

    import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util ...

  8. 2019牛客多校第三场D BigInteger——基础数论

    题意: 用  $A(n)$ 表示第 $n$ 个只由1组成分整数,现给定一个素数 $p$,求满足 $1 \leq i\leq n, 1 \leq j \leq m, A(i^j) \equiv 0(mo ...

  9. STL练习板子题(c++11警告)

    第一题 词典 总时间限制: 3000ms 内存限制: 65536kB 描述 你旅游到了一个国外的城市.那里的人们说的外国语言你不能理解.不过幸运的是,你有一本词典可以帮助你. 输入 首先输入一个词典, ...

  10. 023_STM32之PID算法原理及应用

    (O)关于程序BUG说明,看最后面的红色字体,视频和源代码中都没有说明 (一)PID控制算法(P:比例 I:积分 D:微分) (二)首先先说明原理,使用的是数字PID算法,模拟PID算法在计算机这样的 ...