2016-04-27 11 views
5

JDBCを使用してmysqlデータベースに接続するとこのエラーが発生します。JDBC接続エラー:認識できないタイムゾーン

Database.getConnection() Error -->The server time zone value 'EEST' 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. 

これは私の接続コードです。

public static Connection getConnection(){ 
    try { 
     Class.forName("com.mysql.jdbc.Driver"); 

     Connection con = DriverManager.getConnection(
       "jdbc:mysql://localhost:3306/management", "root", "root"); 
     return con; 
    } catch (ClassNotFoundException | SQLException e) { 
     // TODO Auto-generated catch block 
     System.out.println("Database.getConnection() Error -->" 
       + e.getMessage()); 
     return null; 
    } 

} 
+0

エラーメッセージは十分にクリアです。 *あなたはそれについて何を正確に理解していませんか? – Raedwald

+0

さて、サーバーのタイムゾーンを修正しようとしましたか? –

+1

serverTimezone設定プロパティが見つかりませんでした。 – mcemilg

答えて

4

私はMysqlとシステムのミスマッチタイムゾーンに問題があると思います。 その値を同期させる方が良いです。 以下のリンクを参照して時刻を設定することもできます。How do I set the time zone of MySQL?

関連する問題