Basically, think about it this way: There is a reason why mySQL comes with functions to repair tables and databases and why phpMyAdmin (for example) offers an easy way to use them. It is like brushing your teeth. Do it regularly. Errors happen, don't let them add up.
But you might want to try and find out what causes the corruption: Did you get the mySQL error message before you repaired (so you could try and track down what caused the error)? Is there some error log you could now still look at?
The errors can occur because of hardware problems on the database server. Hosters like to run their machines to death before they replace them. It could also be a software bug in the mySQL code. Or you are doint administration on a live table (one that at the same time is being accessed by other users like your web server). etc. If you can find the culprit, you might have an option to avoid future corruption.
If you cannot find the error, consider moving your database to a new server. In a hosting environment, simply "order" a new database through the adminstration panel, copy the data, and point your wiki to the new database. Then see if this works better. But might of course work worse ...
And (first of all): Set up a cronjob to dump your database on a regular basis so whatever happens you won't loose your data. Kind of like this:
* * * * * mysqldump db_name -u username -ppassword > /home/username/backup.sql
or have the cronjob call a script (.php, .sh, whatever) to do different stuff like change the name of the dump etc.
My host said my tables were corrupted. So I repaired the database and it fixed the issue. Strange?
On Thu, Feb 12, 2009 at 12:05 PM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
If you are on a shared server, or, as in many hosting situations even when you have your own server, you are on a shared database server, it might well be another website that is bringing that shared database server down.
Anyway, we'll see what your provider comes up with.
I haven't changed any php except small changes to LocalSettings.php last week, but it was nothing related to this.
My traffic hat not spiked recently but I do have my host looking at the issue. Thanks for the tips.
Anything else on the issue would be appreciated.
On Thu, Feb 12, 2009 at 11:43 AM, Manfred Kooistra manfred.kooistra@gmx.dewrote:
Line 826 (in my code) is this:
$s = $dbr->selectRow( 'user', '*', array( 'user_id' => $this->mId ), __METHOD__ );
it appears to be related to a mySQL query. Usually the error you get in PHP means that some variable, that you try to work with, has not been set or is FALSE, e.g. $dbr.
Reading about the connection error you get in phpMyAdmin, I'd guess that PHP encounters the same, when it tries to connect to your database and fill the variable. So I'd begin looking at your DB, _if_ you are sure that you have not changed anything in your PHP code!
I don't know much about Apache and stuff, but I had a big problem once when due to a listing in some very popular web catalogue I suddenly recieved thousands of hits a day (compared to maybe 100 the day before). The increase in traffic was so intense that it brought my DB down. I solved the problem with making all pages static. This was possible on that website, simply by having a cronjob execute once each night and build all pages from the database. But that website was not a wiki, with user contribution. Anyway ...
... try and find out about the performance of your database. I don't know how, I had someone look at the logs and interpret them for me, and he installed a small script that recorded what happened on the database server etc., so maybe start with calling your provider and ask them about _their_ server and tell them that you see performance problems.
Hope all this bla bla helps you!
~ Manfred
Hey all,
About one every 5 page views mediawiki throws this error:
Fatal error: Call to a member function selectRow() on a non-object in User.php on line 826
I have not recently upgraded. I have been on version 1.13.3 since it
was
released. The site was working fine until this morning and rebooting
mySQL
didn't help. I also get a connection error every couple of loads if I
click
through my databases in phpmyadmin. Does anyone know what could be
wrong?
I
have shell access.
Thanks _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l