MySQL 数据库时区设置方法,“The server time zone value ‘�й���ʱ��‘ is unrecognized or represents ...” 问题解决
生活随笔
收集整理的這篇文章主要介紹了
MySQL 数据库时区设置方法,“The server time zone value ‘�й���ʱ��‘ is unrecognized or represents ...” 问题解决
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
連接 mysql 數據庫時提示如下異常,是時區問題導致的。
An error occurred while establishing the connection:Long Message: 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.Details:Type: java.sql.SQLExceptionSQL State: 01S00報錯翻譯:
服務器時區值 ‘�й���??��’ 無法識別或表示多個時區。如果您想利用時區支持,您必須配置服務器或 JDBC 驅動程序(通過 ‘serverTimezone’ 配置屬性)來使用更具體的時區值。
解決方法:
修改 my.ini 文件,加入時區設置 default-time_zone='+8:00' 即可,重啟 mysql 服務生效。
不重啟 mysql 服務臨時生效可以這樣設置
set global time_zone='+8:00';
flush privileges;
喜歡的點個贊?吧!
總結
以上是生活随笔為你收集整理的MySQL 数据库时区设置方法,“The server time zone value ‘�й���ʱ��‘ is unrecognized or represents ...” 问题解决的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux 系统安全 - 近期发现的 p
- 下一篇: MySQL 数据库修改访问权限,不能使用