no matter but if restart mysql this setting resets.
[color=rgb(0,0,205);]Variant 2.[/color]
U have full access to mysql server and u can enter SSH as a root user:
[color=#000000]run below command:[/color]
#mysql or mysql -u root -p
than enter the password
[color=rgb(51,51,51);font-family:'Droid Sans', Arial, Verdana, sans-serif;font-size:13px;]1) Check time_zone* tables in mysql database.[/color]
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql
[color=rgb(51,51,51);font-family:'Droid Sans', Arial, Verdana, sans-serif;font-size:13px;]2) To change / update timezone [/color]
set global time_zone = timezone; Example: set global time_zone = "Asia/Calcutta";
restart mysql.
[color=rgb(51,51,51);font-family:'Droid Sans', Arial, Verdana, sans-serif;font-size:13px;]You can change the time zone as per the requirement without root user.[/color]
set time_zone = timezone;
[color=rgb(51,51,51);font-family:'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;]You can see the full list of possible values for ZONEINFO at /usr/share/zoneinfo [/color][color=#ff0000][font="'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;"]or[/color][/font]
VPS. F[color=rgb(0,0,0);font-family:verdana, sans-serif, arial, helvetica;font-size:12px;]rom an SSH:[/color]
ls /usr/share/zoneinfo/
[color=rgb(0,0,0);font-family:arial, geneva, sans-serif;]Then simply delete the current timezone:[/color]
rm /etc/localtime
[color=rgb(0,0,0);font-family:arial, geneva, sans-serif;]And replace it with a symbolic link to the new timezone from /usr/share/zoneinfo. For example if your chosen zone is Pacific time:[/color]
ln –s /usr/share/zoneinfo/PST8PDT /etc/localtime
[color=#0000cd][font="'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;"]Or you can use the tzselect command:[/color][/font]
[color=#000000][font="'Droid Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;"]You may need to remove the existing symlink before using tzselect[/color][/font]
rm -f /etc/localtime
than use
tzselect
You can make this change permanent for yourself by appending the line
TZ='timezone';
export TZ to the file '.profile' in your home directory; then log out and log in again.
Synchronizing time with NTP server
[color=rgb(0,0,0);font-family:arial, geneva, sans-serif;]The first step is to make sure you have the ntp program installed. Do a:[/color]
which ntpdate
[color=#000000][font="arial, geneva, sans-serif;"]Once ntp is installed synchronize your computer clock with:[/color][/font]
ntpdate pool.ntp.org
[color=#000000]If ntp is not install, you may run this to install ntp[/color]
yum install ntp
[color=#000000] To set time and date[/color]
date MMDDhhmmYYYY
[color=rgb(102,102,102);font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;font-size:12px;]MM - Two digit month number[/color]
[color=rgb(102,102,102);font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;font-size:12px;]DD - Two digit date[/color]
[color=rgb(102,102,102);font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;font-size:12px;]hh - Two digit 24 hour system hour[/color]
[color=rgb(102,102,102);font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;font-size:12px;]mm - Two digit minute[/color]
[color=rgb(102,102,102);font-family:'Lucida Sans Unicode', 'Lucida Grande', sans-serif;font-size:12px;]YYYY - Four digit year code[/color]
Edited by Rand, 17 January 2015 - 11:34 PM.