Database Tablespace being corrupted - Prevention?
Posted by: BlackPearl (---.range81-152.btcentralplus.com)
Date: June 25, 2016 06:41PM

Hello,
Long time user of WAMP, first time problem I couldn't google.

I'm using Win7 64bit and WAMP 2.5 64bit. Pretty much as it comes out of the download folder, I think the only real change is turning on mod_rewrite.

Something is messing up my Tablespaces, it's usually all tables within one database, the rest remain functional.

This has happened a couple of times and luckily I've had backups so not needed to go the extent of fixing that DB. Which seems to be a long and complicated procedure, one day I might not be so lucky so I'd rather avoid it altogether.

The last messed up DB, one had about 15 tables, one at most had 50 entries, most tables where 1-10 entries. My other databases, just 8, generally are small, and by small I mean <3K entries, total.

I would like to stop this happening but I do not know what could be causing it. I've a reliable computer and an error free Windows AFAIK.

Apologies I can't say more, I'm very much interested in prevention or knowing causes.



Edited 1 time(s). Last edit at 06/25/2016 06:41PM by BlackPearl.

Options: ReplyQuote
Re: Database Tablespace being corrupted - Prevention?
Posted by: Otomatic (Moderator)
Date: June 25, 2016 06:53PM

Hi,

> I would like to stop this happening

Always exit Wampserver BEFORE switch off Windows

Exit Wampserver stop MySQL "normally" and allows everything that can still be in the MySQL caches to be written correctly in tables.
If Windows is stopped before stopping MySQL that is to say before leaving Wampserver, caches can not be written and this can give corrupted tables.

And pay attention to some Windows updates that perform automatic restarts while Wampserver was launched.

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: Database Tablespace being corrupted - Prevention?
Posted by: BlackPearl (---.range81-152.btcentralplus.com)
Date: June 25, 2016 08:16PM

Otomatic Wrote:
-------------------------------------------------------
> Always exit Wampserver BEFORE switch
> off Windows

I'm fairly certain I do.

> Exit Wampserver stop MySQL "normally" and allows
> everything that can still be in the MySQL caches
> to be written correctly in tables.
How long is stuff kept in the caches? I don't run anything cron-y so unless I'm working on something and bamf I turn off the computer (which would be weird) the cache shouldn't be in use.

> If Windows is stopped before stopping MySQL that
> is to say before leaving Wampserver, caches can
> not be written and this can give corrupted
> tables.
Could MySQL still be running even though the WAMP icon is gone? I have it's notification icon set to always on.

> And pay attention to some Windows updates that
> perform automatic restarts while Wampserver was
> launched.
Updates aren't being done.

Great points so far. Thanks, any other possible? Virus scanners messing up ip files?

Options: ReplyQuote
Re: Database Tablespace being corrupted - Prevention?
Posted by: Otomatic (Moderator)
Date: June 26, 2016 10:03AM

Hi,

Although theoretically PHP closes the MySQL connection at the end of a script, it is highly recommended to always explicitly close the MySQL connection.
Moreover, persistent connections are not closed automatically, so be it : [fr2.php.net]

That's all I can say on this subject.
Having always follow these "rules", I have never encountered database corruption issue; This does not prevent me to make backups!

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, only registered users may post in this forum.