Load timezones for MySQL

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

Load timezones for MySQL

Postby zenichanin » 29. June 2016 15:59

Ok so I found the mysql_tzinfo_to_sql file located in /xampfiles/bin. So I CD into that directory, then run "mysql_tzinfo_to_sql /usr/share/zoneinfo" and it goes through a whole bunch of stuff which looks like it's loading time zones and when it's completed, it looks like it succeeded. But when I go into database to check the timezone table, it is still blank. So I don't know if it inserted it into Mac's default MySQL database? Anyone know how I can do this? Thanks!
zenichanin
 
Posts: 3
Joined: 29. June 2016 15:57
XAMPP version: 5.6.15-1
Operating System: Mac OS X El Capitan

Re: Load timezones for MySQL

Postby Nobbie » 29. June 2016 17:48

zenichanin wrote:So I don't know if it inserted it into Mac's default MySQL database?



Of course not, this tool does not know anything about your databases und users, it is a plain generator. Redirect the output to a file, for example to /tmp/zoneinfo.sql:

Code: Select all
./mysql_tzinfo_to_sql /usr/share/zoneinfo >/tmp/zoneinfo.sql


This creates zoneinfo.sql in folder /tmp. You may choose any folder and any name. After execution the file contains the appropriate SQL commands to insert the data into a database. But this is not yet included in your database. I dont know the purpose of that tool and i dont know where you need these tables, but you might run PhpMyAdmin, create or open the database of your choice and run an import of the zoneinfo-file created above.
Nobbie
 
Posts: 8759
Joined: 09. March 2008 13:04

Re: Load timezones for MySQL

Postby zenichanin » 30. June 2016 15:41

Thanks Nobbie.

With that, I get an error:

Code: Select all
Warning: Unable to load '/usr/share/zoneinfo/+VERSION' as time zone. Skipping it.


If I go to /usr/share/zoneinfo and open the +VERSION file, it just has 2016d in it.

Any ideas?
zenichanin
 
Posts: 3
Joined: 29. June 2016 15:57
XAMPP version: 5.6.15-1
Operating System: Mac OS X El Capitan

Re: Load timezones for MySQL

Postby Nobbie » 30. June 2016 17:03

zenichanin wrote:Any ideas?


Missing rights?
Empty file?
Empty folder?
Invalid Syntax in the file?

Do you need this file? It is only a warning, nothing else. It is NOT an error (as you said). You dont get any error message. Only a warning.
Nobbie
 
Posts: 8759
Joined: 09. March 2008 13:04

Re: Load timezones for MySQL

Postby zenichanin » 30. June 2016 17:26

Ahh ok looks like it still saved the export it just didn't give feedback or confirmation. Anyways this should work. Thanks for your help.
zenichanin
 
Posts: 3
Joined: 29. June 2016 15:57
XAMPP version: 5.6.15-1
Operating System: Mac OS X El Capitan

Re: Load timezones for MySQL

Postby Nobbie » 30. June 2016 18:19

zenichanin wrote:just didn't give feedback or confirmation.


Did it before? (Answer: No, never ever).

How long would it take simply to look into the output file, if its empty or not? (Answer: 1 second?! Maybe 2 seconds?)

Life can be so easy...
Nobbie
 
Posts: 8759
Joined: 09. March 2008 13:04


Return to XAMPP for Mac OS X

Who is online

Users browsing this forum: No registered users and 2 guests