To setup the ability to use time zone features in MySQL like CONVERT_TZ(), for example, you need to setup time zone support in your MySQL install. These steps are specifically for MAMP Pro, but will work for any install as long as you change the paths appropriately.
- Open Terminal
- Run the following command…
[code]/Applications/MAMP/Library/bin/mysql_tzinfo_to_sql /usr/share/zoneinfo/ |/Applications/MAMP/Library/bin/mysql -u root -p mysql[/code]
If you have already updated your command line services per MAMP Pro Setup then you can simply run…
[code]mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql[/code]
- When prompted, enter your MySQL root password
- Restart MySQL
You can also refer to the official documentation… 10.6 MySQL Server Time Zone Support.