How To Add TimeZone Support To MySQL Using Perl DBI
erics, Posted April 24th, 2011 at 10:36:22pm
First, make sure MySQL server has the time zone tables loaded, which are NOT there by default!
1 2 |
# mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql # service mysqld restart |
Next, tell MySQL to use the desired time zone via Perl:
1 2 |
my $dbh = DBIx::SQLEngine->new( ${dsn}, '{login}', '{passwd}' ); $dbh->do_sql("SET time_zone = 'America/New_York';"); |
Leave Your Comment
All fields marked with "*" are required.