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.

  1. Open Terminal
  2. 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]

  3. When prompted, enter your MySQL root password
  4. Restart MySQL

You can also refer to the official documentation… 10.6 MySQL Server Time Zone Support.

5 1 vote
Article Rating
in Mac OSX, MAMP, MySQL
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback
7 years ago

[…] Follow these instructions… Install MySQL Time Zone Support on MAMP Pro […]