As always,
make sure to back up your database before running queries!
For attachments:
Try running this query:
Code:
UPDATE post SET attach = 0;
You should then also be able to truncate the
attachment table.
If both types of the following images are stored in the database, try these 2 queries...
For avatars:
Try running this query:
Code:
DELETE FROM customavatar USING customavatar LEFT JOIN user ON user.userid = customavatar.userid
For profile pics:
Try running this query:
Code:
DELETE FROM customprofilepic USING customprofilepic LEFT JOIN user ON user.userid = customprofilepic.userid
This is untested, but it should work. Just remember,
make sure to back up your database before running queries!