Posted 08 July 2006 - 11:17 PM
So I want to set the timezone for MySQL. mysql.org says I should use this:
mysql> SET GLOBAL time_zone = timezone;
But what do I do with that? I tried inserting it into .htaccess and I tried using mysql_query(SET GLOBAL time_zone = timezone;) in PHP, but neither worked. What do I do?
Posted 09 July 2006 - 03:11 PM
daniel@daniel:~$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 36 to server version: 5.0.22-Debian_0ubuntu6.06-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> SET GLOBAL time_zone = '+1:00';
Or in PHP you could do it in this way:
<?php $link = mysql_connect("localhost","root","password"); mysql_query("SET GLOBAL time_zone = '+1:00';"); ?>
These examples will set the timezone to GMT+1 (CET).
Posted 10 July 2006 - 01:03 AM
Posted 10 July 2006 - 03:50 AM
-How do I view the my.cnf file (I'm using a hosting company, mysql isn't on my computer)
-So if I use GLOBAL, do I only need to do it once ever, and never include it with any page with queries?
Posted 10 July 2006 - 04:47 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users