Forum Moderators: phranque

Message Too Old, No Replies

Mysql Optimization

Cron Job?

         

futureX

10:48 pm on Sep 1, 2003 (gmt 0)

10+ Year Member



Hi guys, I have a website that is using a php script, and ever since my host upgraded to the latest versions of mysql and php there have been problems with my tables corrupting (from a forum software). Generally i've found that optimizing the tables (either from within the sofware itself or from phpmyadmin) regularly reduces the probability of the tables being corrupted.

I just wondered if there was any script or procedure i could take that could do at least one of the following:

Check through my mysql tables every 10 minutes
Optimize them.
If any corrupt tables are found repair them.

Thanks for any help

Netizen

2:02 pm on Sep 2, 2003 (gmt 0)

10+ Year Member



Personally I would talk to the hosting company - if they upgraded from MySQL 3.23.* to 4.0.* there might be issues (although there shouldn't be). The mysqld may be crashing regularly and corrupting your tables - rather than trying to repair them all the time, try to fix the source of the problem.

karmov

3:02 pm on Sep 2, 2003 (gmt 0)

10+ Year Member



Always a smart idea to resolve the problem rather than put a bandage over it. Although it might work well for now to optimize every 10 minutes, you have to consider what happens when your forums get more popular and you need you optimize more often, every 5 minutes? Every minute? Then what? You'll invariably end up with a server doing nothing but optimizing and having a hard time actually serving pages.

Sometimes if you look in the right places, the root cause is easier to solve than the patchwork solution you might be considering. Besides, you never know what other problems this could be causing (or could later cause).

MatthewHSE

3:23 pm on Sep 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm having the same problem with one of my tables. From time to time, a row gets added and then the table is corrupted until I repair it. Does anyone have any ideas on how tables could be getting corrupted like this?

I'm on a Linux server running the 4.0.14-standard version of MySQL.

futureX

1:51 pm on Sep 3, 2003 (gmt 0)

10+ Year Member



Thanks for the advice, i guess i'll email my host and get them to change the MySql, I was a little reluctant to do this because I am on a shared hosting play. But i'm sure if I ask them they will do it for me as they have had no problems with anything like that before :)