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.

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.

Spring BootでMySQLに接続する」を参考にMySQLやJPAを試そうと思ったのですが、表題のエラーが発生しました。昔は接続できたのに、、と思って調べているとタイムゾーンがサポートされていないとか書いてあるっぽいのでapplication.propertiesを以下に変更します。

変更前

変更後

これでOKと思ってSpring Bootアプリケーションを起動すると今度は「Loading class com.mysql.jdbc.Driver’. This is deprecated. The new driver class iscom.mysql.cj.jdbc.Driver’. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.」というエラーが発生しました。

なんとcom.mysql.cj.jdbc.Driverは非推奨だそうです。

いつの間にか非推奨になっていて、未指定のままでOKだそうです。

これで無事起動することができました。

ちなみにこの時のスタータープロジェクトは以下です。

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.

スポンサーリンク
スポンサーリンク

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA


:)