Reputation: 733
We are using a Google Cloud SQL instance, and we need to populate the time zones without using a Linux computer.
The answer to this SO question outlines how to accomplish this using Linux: Change Google Cloud SQL CURRENT_TIMESTAMP time zone?. And this post demonstrates how to accomplish this with MySQL on Windows, if you have access to the Windows server files: http://www.geeksengine.com/article/populate-time-zone-data-for-mysql.html.
However, neither of these work for our situation; we need to populate the time zones remotely, using a Windows computer, without access to the remote file system. I think all we really need is the output of mysql_tzinfo_to_sql, except that we don't have a Linux computer to run this command. And MySQL's pre-populated download does us no good because we do not have access to the remote file system.
So can we populate the time zones for a Google Cloud SQL instance remotely using a Windows computer?
Upvotes: 0
Views: 780
Reputation: 1008
Two options.
Option 1: You can use mysql_tzinfo_to_sql /usr/share/zoneinfo to get the file. The file just contains a bunch of sql statements to populate the timezone table. Then you can pipe it to your windows mysql remotely.
Option 2: You can launch a local mysql server on your local windows machine. Download the prepackaged mysql time zone tables and populate your local mysql server. After that you use mysqldump to generate a file containing sql statements for your timezone tables. Then you use this file to populate your remote mysql server.
For both options, you can optionally put the dumped sql file into a Google Cloud Storage bucket and do an import from that file (https://cloud.google.com/sql/docs/import-export#importdatabase). It will import much faster than you do from your local machine.
Upvotes: 3