Time issue in mysql databases

ohad

New member
Joined
May 24, 2005
Messages
1
Hello ,

regretfully, i encountered a problem about 2 months ago .
the time and the date in my Web Hosting server were not updated .
after i added clients , databases and forums that worked i decided to move the time and date 4 hours back as required .
Today , the time is : 24.05 and the hour is 13:30 , but in the server it showes that the date is now : 21.06 and the time : 17:30.
when i try to move the time and date in the server to the correct time , its causing a major problem in all MYSQL system and forums
that uses the MYSQL.
the problem is like : we see 200 people connected to the forum allthough only 30 is actually there .
or , the messages we brodcast on the forums get very old date (because the server thinks we are a month forwerd.)

Defenetly , one big mess that we cant figure out .
the quastion is if there is a possibilty to update all the databases to the correct time , but in the same time the messages wont get a one month forwared ,
if there is a subject written in the 14.02 that he will move to the 14.01 .

i will be so happy if you can help me ,

Thank you ,

ohad
 
1. Just set the server time/date to the correct one. This will cause some problems in the beginning, but should resolve itself over time.

2. If you really want to know how to fix all date times in the database, you should alter them all by hand. Check where date values in the tables are written and somehow change the datetime with the mysql datetime functions.

I would go for the first one ;)
 
Thankfully I've never had a gap that big to close. There will be problems for the same ammount of time that your moved the system clock back.
So setting the clock back as fusionictnl suggested would result in around 4 hours of trouble, or something like that because there would be date issues with time sensative data (such as forums etc)

I think I remember reading something with critical data like this, that it's possible and preferable, to correct the system date over a period of time making small adjustments of only a few milli seconds every second. A number small enough that it probably won't cause issues. Sure it'll take several hours to complete, but it's the lesser of two evils.
 
Last edited:
I guess you'll run into the same trouble with forums.

Let say 12 hours later the time/date will be corrected. As forums doesn't work realtime, but processes when a user visits the same problem happens if the clock is 1 day set back (after say, 1 hour). A deamon that restarts and finds out that it's files are corrupted as they are newer as the current time/date.

The OS shouldn't give too much trouble with it, but I guess some applications will run into some trouble. But still you'll have to find out wich ones. I think forums, like vbulletin and phpBB shouldn't experience any problems (maybe pm's that will be delivered again, topics that get posts in history etc.). More likely accounting software etc. could have big issues with this.

Anyway a lot of good luck with it, and post your findings.
 
Last edited:
Within the Operating System configuration. The method in modifying the time varies from OS to OS

For example it could be time or date.
 
Back
Top