1

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.

Bart van Heukelom
  • 1,199
  • 5
  • 20
  • 41

3 Answers3

2

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

Chris S
  • 77,337
  • 11
  • 120
  • 212
Bachsau
  • 21
  • 2
1

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.

Falcon Momot
  • 24,975
  • 13
  • 61
  • 92
  • 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
0

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

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

  • 1
    Welcome to Server Fault! Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference. – Scott Pack Oct 15 '13 at 16:54