Board logo

標題: [操作疑難] [求教]用NetBeans 連結MySQL失敗,原因time zone問題點解決? [打印本頁]

作者: 年逹    時間: 2020-2-16 14:56     標題: [求教]用NetBeans 連結MySQL失敗,原因time zone問題點解決?

本帖最後由 年逹 於 2020-2-16 15:21 編輯

初學MySQL,但用NetBeans 連結MySQL失敗,原因係當login時有以下warning:(見圖)
The server time zone value (亂碼)is unrecognised or represents more than one time zone.You must configure...
求教,應該點做,十分謝謝回答!

[attach]2176394[/attach]
作者: artai    時間: 2020-2-16 21:54

本帖最後由 artai 於 2020-2-16 21:56 編輯

https://www.cnblogs.com/EasonJim/p/6906713.html
JDBC Connection string 的問題...
不知是否NetBeans的Bugs...

國內有人教修改MySQL的 my.ini 配置文件:
https://blog.csdn.net/yuanlaijike/article/details/84105490
作者: 年逹    時間: 2020-2-17 07:08

JDBC Connection string 的問題...
不知是否NetBeans的Bugs...

國內有人教修改MySQL的 my.ini 配置文件:
...
artai 發表於 2020-2-16 21:54

多謝你的幫忙,但對我依位初學者來講太深,可否教一教我如何簡單少少去做.
謝謝!
作者: ylimny    時間: 2020-2-17 22:49

回覆 3# 年逹


    create a file called my.cnf under C:\

add below content

  1. [mysqld]
  2. --default-time-zone="+08:00"
複製代碼

作者: 年逹    時間: 2020-2-18 07:41

回覆  年逹


    create a file called my.cnf under C:\

add below content
ylimny 發表於 2020-2-17 22:49

試左,唔得呀
作者: CVSDF    時間: 2020-2-18 13:39

can u find the connection string in ur code?  post it here.
something like
"jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Europe/Moscow"
作者: 年逹    時間: 2020-2-19 08:47

can u find the connection string in ur code?  post it here.
something like
"jdbc:mysql://localhost/ ...
CVSDF 發表於 2020-2-18 13:39

謝謝你的回答.
但我在Netbeans找不到你所講的connection string in ur code.
請問重有無其他版友可以幫忙?
作者: CVSDF    時間: 2020-2-19 16:01


https://netbeans.org/kb/docs/ide/mysql.html

you have those screens?
作者: 年逹    時間: 2020-2-19 22:18

you have those screens?
CVSDF 發表於 2020-2-19 16:01

巳找到Database URL,修改成以下:
jdbc:mysql://localhost:3306/mynewdatabase?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC

但不成功,只有試過用5.X 的版本成功,但長遠冇可能用5.X版本,求版友想想辨法.
作者: skhui2005    時間: 2020-2-20 15:47

路過的,試試這裏的答案





歡迎光臨 電腦領域 HKEPC Hardware (https://h2.hkepc.com/forum/) Powered by Discuz! 7.2