You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Wildfly 19无法连接MySQL:时区配置错误求助

Fixing WildFly MySQL Datasource Timezone Error

Hey there! Let's sort out this connection issue you're hitting—it's a super common problem when using MySQL 8.0+ connectors with WildFly, so don't worry, we'll get it fixed quickly.

The error message about the unrecognized timezone 'Mitteleuropäische Sommerzeit' tells us exactly what's wrong: MySQL 8.0 changed how it handles timezones, and it doesn't recognize that localized timezone name anymore. We just need to add a specific timezone parameter to your datasource configuration.

Here's how to fix it step by step:

  • Locate your WildFly configuration file
    If you're running WildFly in standalone mode (typical for beginners), open standalone/configuration/standalone.xml (or standalone-full.xml if you're using the full profile) in a text editor.

  • Find your MySQL datasource definition
    Search for the <datasource> block linked to your MySQL connection—it should have a driver-name matching your mysql-connector-java-8.0.20.jar driver.

  • Update the connection URL with the timezone parameter
    In the <connection-url> element, append ?serverTimezone=Europe/Berlin (since 'Mitteleuropäische Sommerzeit' refers to Central European Summer Time, this is the standard timezone ID MySQL recognizes). Alternatively, use UTC for a universal timezone that avoids daylight saving time headaches.
    Example updated URL:

    <connection-url>jdbc:mysql://your-db-host:3306/your-db-name?serverTimezone=Europe/Berlin</connection-url>
    
  • Save and restart WildFly
    Close the configuration file, then stop and restart your WildFly server to apply the changes.

  • Retest the datasource connection
    Head back to the WildFly admin console and test the connection—it should now work without the timezone error.

A quick tip: Using UTC is often safer for server applications because it eliminates confusion from daylight saving time transitions. If you go that route, your connection URL would look like:

<connection-url>jdbc:mysql://your-db-host:3306/your-db-name?serverTimezone=UTC</connection-url>

That's it! This should resolve the "WFLYJCA0047: Connection is not valid" error caused by the timezone mismatch.

内容的提问来源于stack exchange,提问作者Fabi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 08:37:36