Search code examples
phpmysqlmacosmampmamp-pro

Install MySQL Timezone Support (MAMP PRO 3.0.7.3)


I'm trying to figure out how to fill the timezone tables in MySQL. I'm new to developing on a Mac. This is my first time trying to set this up and I'm finding it difficult to find instuctions. I've seen posts where they say the mysql_tzinfo_to_sql file should be located here /usr/share/lib/zoneinfo as it is supposed to come with Macs. Well it didn't with mine. I have a brand new MacBook Pro. Spotlight says the file is located in applications/MAMP/Library/bin so I opened the terminal, went to that directory and typed this in...

Gordons-MacBook-Pro:bin gordonfrobenius$ ./mysql_tzinfo_to_sql | ./mysql -p -u root mysql
Usage:
 ./mysql_tzinfo_to_sql timezonedir
 ./mysql_tzinfo_to_sql timezonefile timezonename
 ./mysql_tzinfo_to_sql --leap timezonefile
Enter password:

I enter the password and nothing happens. The timezone tables are still empty. Please help.

  • MAMP 3.0.7.3
  • MacBook Pro OS X Yosemite v 10.10.2
  • PHP 5.6.2
  • MySQL innodb_version 5.5.38

UPDATE: I just tried running this as other posts suggested, got a little further but not quite there, trying to figure out what this error means now...

Gordons-MacBook-Pro:bin gordonfrobenius$ ./mysql_tzinfo_to_sql /usr/share/zoneinfo | ./mysql -p -u root mysql
Enter password: Warning: Unable to load '/usr/share/zoneinfo/+VERSION' as time zone. Skipping it.

Following this post now, might be on the right path... http://www.larryullman.com/forums/index.php?/topic/2629-ch-6-pg-190-step-by-step-instructions-for-how-to-load-time-zone-table-info/


Solution

  • These instructions solved the problem: http://www.larryullman.com/forums/index.php?/topic/2629-ch-6-pg-190-step-by-step-instructions-for-how-to-load-time-zone-table-info/

    I found that it is easier to move that +VERSION file out of usr/share/zoneinfo by navigating to that location in terminal, then typing open .. That causes a finder to open in that location, then you can drag it to desktop (you will have to authenticate). Then when done loading the timezone data drag it back in.