Error on web site

Permalink 1 user found helpful
Hi does any one know how to fix this error, I get this when i go to the sitemap button?

An unexpected error occurred.
mysql error: [145: Table './dreamsta_cnc51/PageSearchIndex' is marked as crashed and should be repaired] in EXECUTE("select p1.cID, pt.ctHandle from Pages p1 left join Pages p2 on (p1.cPointerID = p2.cID) left join PageTypes pt on (pt.ctID = (if (p2.cID is null, p1.ctID, p2.ctID))) left join PagePaths on (PagePaths.cID = p1.cID and PagePaths.ppIsCanonical = 1) left join PageSearchIndex psi on (psi.cID = if(p2.cID is null, p1.cID, p2.cID)) inner join CollectionVersions cv on (cv.cID = if(p2.cID is null, p1.cID, p2.cID) and cvID = (select max(cvID) from CollectionVersions where cID = cv.cID)) inner join Collections c on (c.cID = if(p2.cID is null, p1.cID, p2.cID)) left join CollectionSearchIndexAttributes on (CollectionSearchIndexAttributes.cID = if (p2.cID is null, p1.cID, p2.cID)) where 1=1 and p1.cParentID = '0' and (p1.cIsTemplate = 0 or p2.cIsTemplate = 0) and (p1.cID not in (5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,65,66,67,68,69) or p2.cID not in (5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54,55,65,66,67,68,69)) ")

 
Mainio replied on at Permalink Reply
Mainio
Run this on your SQL server:
REPAIR TABLE PageSearchIndex;


Antti / Mainio
peterloveday replied on at Permalink Reply
Thanks for the info is this done from within Concrete 5 or at the Cpanel I can not see a repair option?
Mainio replied on at Permalink Reply
Mainio
Ok,
1. Create a this file: {root}/tools/repair_database.php
2. Add this code into that file:
<?php
$db = Loader::db();
$db->query('REPAIR TABLE PageSearchIndex');
echo "Your database is now repaired!";

3. Browse to /index.php/tools/repair_database

4. Delete the file from your tools-folder, if you leave it there it is a big security thread for your site
bishopdennis replied on at Permalink Reply
bishopdennis
This worked great for me. So simple. Thank you!!!