I took an old project in github, and the project was about a JSF application that was using the old mysql artifact as you can see below;
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.25</version>
<scope>compile</scope>
</dependency>
and was generating errors, and by what I understood I should change to the version compatible with the version I was using in my database, so I checked the version of my command with the command;
SoItradedforthisartifact;
<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>8.0.11</version></dependency>
WhenIsubmittedmyform,Icameacrossa500erroronthebrowserscreen,andwhenIcheckedtheerrorloginmyeclipseIfoundthiserrorbriefly;
Causedby: com.mysql.cj.exceptions.InvalidConnectionAttributeException:The servertimezonevalue'Brazilofficialtime'isunrecognizedor morethanonetimezone.Youmustconfigureeitherthe serverorJDBCdriver(viatheserverTimezoneconfigurationproperty) touseamorespecifctimezonevalueifyouwanttousetimezone support.
Soitwasaboutadjustingthetimezoneofmysql,buthowtodothat?Imademyattemptsandcouldnot,that'swhyI'maskingforhelp!
Imadetheseattempts
How to adjust the timezone or timezone on MySQL
How to configure the MySQL time zone by names.
With the command SELECT @@time_zone;
gave this result below;
ThenIchangedbyexecutingthiscommand;
SET@@global.time_zone='+3:00';QUIT
I tried to run the command SET time_zone='America/Sao_Paulo';
but gave the wrong command.
After that, I ran the application again and it worked normally, but restarting the computer and trying everything again got back into trouble.
Please, I would like someone to explain to me how to correctly set the time zone so I have no problem running my applications.