MySQLのJavaの接続時にエラー(時差ぼけ)が発生します

エラー内容:

Exception in thread "main" 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.

ソリューション:
中にDriverManager.getConnection( "JDBCます。mysql:// IP アドレス(ドメイン名)ポート番号/データベース")
テーブル名の後にプラス?serverTimezone=UTC
のような:にDriverManager.getConnection(「JDBCます。mysql: // localhostの:? 3306 / データベースserverTimezone = UTC ""ユーザ名""パスワード「);

公開された90元の記事 ウォン称賛44 ビュー6029

おすすめ

転載: blog.csdn.net/weixin_42947972/article/details/104126449