[ERROR] Failed to execute goal org.openmrs.maven.plugins:openmrs-sdk-maven-plugin:4.5.0:setup (default-cli) on project standalone-pom: Failed to setup server: Failed to connect to the specified database jdbc:mysql://localhost:3306/openmrsDB?serverTimezone=UTC&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&sessionVariables=default_storage_engine%3DInnoDB: The server time zone value ‘Hora est?ndar romance’ 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 specific time zone value if you want to utilize time zone support. → [Help 1]
I am from Europe/Spain and I would like to maintain mySQL database with my timezone. I tried to add this ?serverTimezone=UTC and this ?serverTimezone=Europe/Madrid& as I saw in StackOverflow blogs but it is still failing.
Any solution to create a mySQL server without corrupting mySQL database?
This error message suggests that there is an issue with the server time zone configuration when connecting to the MySQL database. The error is specifically related to the fact that the server time zone value is not recognized or represents more than one time zone, which is causing a failure in the database connection setup.
To resolve this issue, you can configure either the MySQL server or the JDBC driver to use a more specific time zone value. You can try setting the serverTimezone parameter to a specific time zone value in your database connection URL.
For example, if you want to use the time zone ‘UTC’, you can modify the connection URL to the following:
Alternatively, you can configure the MySQL server to use a specific time zone value by setting the default_time_zone parameter in the MySQL configuration file. You can refer to the MySQL documentation for more information on how to configure the default time zone.
I have also tried with serverTimezone = Europe/Madrid and nothing.
As I said before, I’m not interested in changing the server’s timezone because it could corrupt my data.
The other alternative would be to set up a specific docker with UTC timezone but I can’t get docker up either with the SDK as explained in these posts:
Let’s see if someone manages to find the correct solution while I investigate the best approach. Since I imagine that this problem will have happened to more people.
Attached log, always same error with any timezone.