mysqlsqltimezoneconvert-tz

CONVERT_TZ function not working: Time zone data for MySQL


I am trying to use the CONVERT_TZ in MySQL. From what i have looked up the time_zone tables in the mysql schema need to be populated. I have looked this up on many different site and followed a few tutorials including this tutorial but the tables are still not populated

The 15 timezone files have been added to my C:\Program Files\MySQL\MySQL Server 5.6\data\mysql directory.I have tried both to add these files manually and use the mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql as seen here. I have restarted the MySQL service but the tables have still not been updated both ways

Does any have any ideas why?


Solution

  • Solution :

    I found the answer to this here. It seemed that even do I had a folder structure of C:\Program Files\MySQL\MySQL Server 5.6 when i ran the command show variables like 'datadir in MySQL it was pointing to C:\ProgramData\MySQL\MySQL Server 5.6 which is a hidden folder so i did not see it before

    When i added the timezone files to C:\ProgramData\MySQL\MySQL Server 5.6\data\mysql it worked