Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I just discovered that an old MediaWiki of mine was infested with spam, and the database table named "text" (which contains the page content) is 3GB large. I've deleted all the spam pages manually, but:

  • The table is still the same size.
  • I wonder how it got to 3GB anyway. There wasn't that much spam (about a hundred medium-sized pages)

How can I get rid of this mess?

If you want to inspect the wiki, it's over here. The database is MySQL 5.0.75.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

When you delete content from mediawiki using the web interface, it isn't actually deleted (similarly, when pages are deleted on wikipedia, they remain forever and administrators can still view them and undelete them).

If you want to delete the entries, you will have to write some SQL (using the delete statement; eg. delete from <table> where id = <spam post ID>; for each of the IDs.

share|improve this answer
    
I'm not sure deleting the rows will be that easy, I think there will be foreign keys pointing to them. –  svick Apr 14 '12 at 20:27
    
I did DELETE FROM text WHERE old_id IN (SELECT ar_text_id FROM archive). Took forever, but the table is small again now. It probably broke some parts of the wiki (e.g. when viewing these pages in the deletion log) but in this case I don't mind. –  Bart van Heukelom Apr 15 '12 at 14:26
add comment

You should have used the appropriate script in the maintenance-directory. It is there for a reason.

share|improve this answer
add comment

I made shell script that cleans Users activity and accounts in a MediaWiki database:

http://www.actiu.net/mediawiki/

share|improve this answer
1  
Welcome to Server Fault! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. –  Scott Pack Oct 15 '13 at 16:54
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.