Jump to content
Larry Ullman's Book Forums
Sign in to follow this  
Edward

Installing Mysql Time Zones (Mac)

Recommended Posts

I have been bumming around with Mysql timezones all day and got no where.

 

I found your well written article Larry in the last hour

 

http://www.larryullman.com/2011/05/27/utc-and-time-zone-support-in-mysql/

 

I got this problem like you said

 

Warning: Unable to load ‘/usr/share/zoneinfo/+VERSION’ as time zone. Skipping it.

 

But the trouble is when I tired to delete the file or make a new folder to add it into i got permission denied. I was also unable to even find this hidden usr folder. I can see all the time zones are there.

-rw-r--r--    1 root  wheel      6 Jul 22 20:52 +VERSION
drwxr-xr-x   68 root  wheel   2312 Jul 22 20:54 .
drwxr-xr-x   47 root  wheel   1598 Nov 16  2012 ..
drwxr-xr-x   56 root  wheel   1904 Jul 22 20:54 Africa
drwxr-xr-x  144 root  wheel   4896 Jul 22 20:54 America
drwxr-xr-x   13 root  wheel    442 Jul 22 20:54 Antarctica
drwxr-xr-x    3 root  wheel    102 Aug 24  2012 Arctic
drwxr-xr-x   96 root  wheel   3264 Jul 22 20:54 Asia
drwxr-xr-x   14 root  wheel    476 Jul 22 20:54 Atlantic
drwxr-xr-x   25 root  wheel    850 Aug 24  2012 Australia
drwxr-xr-x    6 root  wheel    204 Aug 24  2012 Brazil
-rw-r--r--    1 root  wheel    765 Nov 16  2012 CET
-rw-r--r--    1 root  wheel    837 Nov 16  2012 CST6CDT
drwxr-xr-x   11 root  wheel    374 Aug 24  2012 Canada
drwxr-xr-x    4 root  wheel    136 Jul 22 20:54 Chile
-rw-r--r--    1 root  wheel    871 Apr 29 01:12 Cuba
-rw-r--r--    1 root  wheel    679 Nov 16  2012 EET
-rw-r--r--    1 root  wheel     56 Nov 16  2012 EST
-rw-r--r--    1 root  wheel    837 Nov 16  2012 EST5EDT
-rw-r--r--    1 root  wheel    695 Nov 16  2012 Egypt
-rw-r--r--    1 root  wheel   1285 Nov 16  2012 Eire
drwxr-xr-x   37 root  wheel   1258 Aug 24  2012 Etc
drwxr-xr-x   61 root  wheel   2074 Jul 22 20:54 Europe
-rw-r--r--    1 root  wheel    101 Nov 16  2012 Factory
-rw-r--r--    1 root  wheel   1323 Nov 16  2012 GB
-rw-r--r--    1 root  wheel   1323 Nov 16  2012 GB-Eire
-rw-r--r--    1 root  wheel     56 Nov 16  2012 GMT
-rw-r--r--    1 root  wheel     56 Nov 16  2012 GMT+0
-rw-r--r--    1 root  wheel     56 Nov 16  2012 GMT-0
-rw-r--r--    1 root  wheel     56 Nov 16  2012 GMT0
-rw-r--r--    1 root  wheel     56 Nov 16  2012 Greenwich
-rw-r--r--    1 root  wheel     56 Nov 16  2012 HST
-rw-r--r--    1 root  wheel    438 Jul 22 20:52 Hongkong
-rw-r--r--    1 root  wheel    429 Nov 16  2012 Iceland
drwxr-xr-x   13 root  wheel    442 Aug 24  2012 Indian
-rw-r--r--    1 root  wheel    610 Nov 16  2012 Iran
-rw-r--r--    1 root  wheel    803 Apr 29 01:12 Israel
-rw-r--r--    1 root  wheel    185 Nov 16  2012 Jamaica
-rw-r--r--    1 root  wheel    125 Nov 16  2012 Japan
-rw-r--r--    1 root  wheel     87 Nov 16  2012 Kwajalein
-rw-r--r--    1 root  wheel    493 Apr 29 01:12 Libya
-rw-r--r--    1 root  wheel    765 Nov 16  2012 MET
-rw-r--r--    1 root  wheel     56 Nov 16  2012 MST
-rw-r--r--    1 root  wheel    837 Nov 16  2012 MST7MDT
drwxr-xr-x    5 root  wheel    170 Aug 24  2012 Mexico
drwxr-xr-x    5 root  wheel    170 Aug 24  2012 Mideast
-rw-r--r--    1 root  wheel    882 Nov 16  2012 NZ
-rw-r--r--    1 root  wheel    732 Nov 16  2012 NZ-CHAT
-rw-r--r--    1 root  wheel    877 Nov 16  2012 Navajo
-rw-r--r--    1 root  wheel    165 Jul 22 20:52 PRC
-rw-r--r--    1 root  wheel    837 Nov 16  2012 PST8PDT
drwxr-xr-x   44 root  wheel   1496 Jul 22 20:54 Pacific
-rw-r--r--    1 root  wheel    981 Nov 16  2012 Poland
-rw-r--r--    1 root  wheel   1264 Nov 16  2012 Portugal
-rw-r--r--    1 root  wheel    268 Nov 16  2012 ROC
-rw-r--r--    1 root  wheel    152 Nov 16  2012 ROK
-rw-r--r--    1 root  wheel    171 Nov 16  2012 Singapore
-rw-r--r--    1 root  wheel    993 Nov 16  2012 Turkey
-rw-r--r--    1 root  wheel     56 Nov 16  2012 UCT
drwxr-xr-x   14 root  wheel    476 Nov 16  2012 US
-rw-r--r--    1 root  wheel     56 Nov 16  2012 UTC
-rw-r--r--    1 root  wheel     56 Nov 16  2012 Universal
-rw-r--r--    1 root  wheel    558 Nov 16  2012 W-SU
-rw-r--r--    1 root  wheel    679 Nov 16  2012 WET
-rw-r--r--    1 root  wheel     56 Nov 16  2012 Zulu
-rw-r--r--    1 root  wheel   4326 Nov 16  2012 iso3166.tab
-rw-r--r--    1 root  wheel   1267 Nov 16  2012 posixrules
-rw-r--r--    1 root  wheel  20066 Jul 22 20:52 zone.tab

rm +VERSION
override rw-r--r--  root/wheel compressed for +VERSION? Y
rm: +VERSION: Permission denied

 

Share this post


Link to post
Share on other sites

Thanks that did the trick Larry i didn't see the sudo command written in the terminal manual i was reading.

 

Okay like you said in your manual the script did through some extra errors while trying to load the time zones, here is what i got:

 

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

 

I fixed this by editing:

 

tmp/mysql/my.cnf (Set my password in here)

 

(It is also worth noting that the mysql server must be turned on for the time zones to install)

 

So after the edit and this command was entered at terminal

 

./mysql_tzinfo_to_sql /usr/share/zoneinfo | ./mysql -p -u root mysql

 

The time zones were successfully installed, well most of them... :huh:

 

Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Asia/Riyadh89' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh87' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh88' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/Mideast/Riyadh89' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.

 

OMG! I have 579 time zones in my database now, that's about 10 times more than i expected.

 

HartleySan: I was only planning on using SSL on certain scripts of the site, SSH is not something i looked into. Thanks

Share this post


Link to post
Share on other sites

Yes, i figured that this may be useful for someone else so i tried to make the helped solution as detailed as possible.

 

Actually after futher investigation of time zones today i will be leaving them out for now and possibly build them in later when the website is fairly active. As long as relevant database attributes are timestamps you can really do anything you please later on. Again thanks for your help.

Share this post


Link to post
Share on other sites

Sometimes, I thank god I'm on a provider that does this kinda stuff for me. I had to install some locals a couple of months ago, and only had to snap my fingers! (And write an email) Good work solving this one. :)

Share this post


Link to post
Share on other sites

Yeah it can get to be some complicated stuff but like i said for now i will work with the server time, i may add the time zones when i can get someone yes just someone on the site, lol. Some days i find i make no progress with coding, brain is kind of clustered just thinking about all this stuff, but as from today i am on the roll once again. :rolleyes: Ah one last thought we should never forget Larry he is like the biblical writer of computer books, if it were not for him, we may not be able to get this far. Thanks Larry, i flick through your books every day!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...