以下是删除所有这些行的诱饵切换方法:
CREATE TABLE wp_posts_new LIKE wp_posts;
ALTER TABLE wp_posts_new DISABLE KEYS;
INSERT INTO wp_posts_new SELECT * FROM wp_posts
WHERE post_type\'http\'
AND post_title<>\'GET http://twitter.com/statuses/user_timeline/@xcentric.json?count=100\';
ALTER TABLE wp_posts_new ENABLE KEYS;
ALTER TABLE wp_posts RENAME wp_posts_old;
ALTER TABLE wp_posts_new RENAME wp_posts;
现在开始使用您的网站。
当你完全确定wp_posts
工作正常,然后可以删除旧文件:
DROP TABLE wp_posts_old;
或者你可以把它放几天,以后再放下。
如果要将旧表放回原位,请按如下方式将其切换回原位:
ALTER TABLE wp_posts RENAME wp_posts_new;
ALTER TABLE wp_posts_old RENAME wp_posts;
试试看!!!
UPDATE 2012-01-05 17:27 EDT
删除贴子标题中包含twitter的http贴子
CREATE TABLE wp_posts_new LIKE wp_posts;
ALTER TABLE wp_posts_new DISABLE KEYS;
INSERT INTO wp_posts_new SELECT * FROM wp_posts
WHERE NOT (post_type=\'http\' AND LOCATE(\'twitter\',post_title) > 0);
ALTER TABLE wp_posts_new ENABLE KEYS;
ALTER TABLE wp_posts RENAME wp_posts_old;
ALTER TABLE wp_posts_new RENAME wp_posts;