I have been struggling with MySQL timezone issues for a while I think I finally know why. In the past 2 days my timestamps were saved 2 hours behind my actual machine time (2+ UTC Jerusalem).
I tried running these commands:
SELECT @@global.time_zone; SELECT @@session.time_zone;
And they both return SYSTEM, which means MySQL configures it's timezone based on a .cnf/.ini file. Problem is that I have no such file. I have went through all the "default locations" MySQL is supposed to read it's configuration from and there was not one file. My machine right now is 9:15 AM (UTC +2) but for some reason MySQL timestamps save at 7:15 AM.
In a fluke I caught this piece of condemning info:
Apparantly the server reads it's configuration from .ini inside a 5.5 version of MySQL. But it didn't exist! Only after I used the "Options file" inside workbench for the first time it created it. Here is where:
Mind you I never used 5.5. I am too young for that (though I have and old installation of WAMP from the days I screwed around with wordpress). I tried to diagnose the situation by trying to find my installed version of MySQL but I got this error:
mysql: [ERROR] Found option without preceding group in config file C:\Program Files\MySQL\MySQL Server 8.0\my.cnf at line 1. mysql: [ERROR] Fatal error in defaults handling. Program aborted!
Any reason why 8 MySQL server wishes to read .ini files from a 5.5 folder that didn't even exist?