You must configure either the server or JDBC driver (via the serverTimezone configuration property)
最近在学习Django 框架开发web管理后台的时候,发现连接mysql数据库的时候一直报错
“Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; 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.”
简直崩溃,百度了好几个都没有找到合适的!!!!!!!
最终抓到一个小哥哥的踩坑经验,一下子通过了,特意转发他的过来帮助更多像我一样无依无靠的可怜人儿~~~
号外:django的settings中我是设置好了以下几项的
圆规正传(言归正传):
在pycharm 中的terminal里进入mysql环境,登录完成后,show databases 一下,大概是确保进入没有问题吧???~~~随后输入 set global time_zone=’+8:00’; 即可设置完成。
再连接一下mysql
完美~~~
原文:https://blog.****.net/ZKK199704/article/details/88950106