« Eiffel Tower 'most disappointing' tourist spot | Main | License Plate Mount for XR400 »
August 19, 2007
Closing Old MT Posts to Trackback Spam
I spent a while trying to get the MovableType plugin MT-Close2 to work. Unfortunately, it's obsolete and unsupported. If I try to use it with version 3.2 of MovableType, I get this error "There are no entries selected by this criteria!". But, my Perl skills are nothing to write home about. So, in the end, I just signed into my database and updated the table using SQL.
SQL commands to close Trackbacks in Extended Entry.
Of course, before you update anything, you'll want to create a backup of your database. In Windows, I created the following folder: :
D:\_backup3\MySQL\pw
Then, at the DOS command prompt, I typed: :
mysqldump -u root –ppassword pw > D:\_backup3\MySQL\pw\mysql.sql
(Note: MySQL is a maddening little disaster. Cut and paste doesn't work for me for some reason. Try
typing in each command. And don't use a semi-colon at the end.)
C:\>mysql -uroot -p**********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7159 to server version: 4.1.10-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> select version(), current_date;
+-----------+--------------+
| version() | current_date |
+-----------+--------------+
| 4.1.10-nt | 2007-08-19 |
+-----------+--------------+
1 row in set (0.03 sec)
mysql> show databases;
+----------+
| Database |
+----------+
| mysql |
| pw |
| test |
+----------+
3 rows in set (0.02 sec)
mysql> use pw;
Database changed
mysql> show tables
-> ;
+----------------------+
| Tables_in_pw |
+----------------------+
| mt_author |
| mt_blog |
| mt_category |
| mt_comment |
| mt_config |
| mt_entry |
| mt_ext_bl_group |
| mt_ext_bl_groupmap |
| mt_ext_bl_item |
| mt_ext_bl_log |
| mt_ext_bl_permission |
| mt_ext_bl_source |
| mt_ext_bl_update |
| mt_fileinfo |
| mt_ipbanlist |
| mt_log |
| mt_notification |
| mt_permission |
| mt_placement |
| mt_plugindata |
| mt_session |
| mt_tbping |
| mt_template |
| mt_templatemap |
| mt_trackback |
+----------------------+
25 rows in set (0.00 sec)
mysql> desc mt_entry;
+----------------------+--------------+------+-----+-------------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+--------------+------+-----+-------------------+----------------+
| entry_id | int(11) | | PRI | NULL | auto_increment |
| entry_blog_id | int(11) | | MUL | 0 | |
| entry_status | smallint(6) | | MUL | 0 | |
| entry_author_id | int(11) | | MUL | 0 | |
| entry_allow_comments | tinyint(4) | YES | | NULL | |
| entry_allow_pings | tinyint(4) | YES | | NULL | |
| entry_convert_breaks | varchar(30) | YES | | NULL | |
| entry_category_id | int(11) | YES | | NULL | |
| entry_title | varchar(255) | YES | | NULL | |
| entry_excerpt | text | YES | | NULL | |
| entry_text | text | YES | | NULL | |
| entry_text_more | text | YES | | NULL | |
| entry_to_ping_urls | text | YES | | NULL | |
| entry_pinged_urls | text | YES | | NULL | |
| entry_keywords | text | YES | | NULL | |
| entry_tangent_cache | text | YES | | NULL | |
| entry_created_on | datetime | YES | MUL | NULL | |
| entry_modified_on | timestamp | YES | | CURRENT_TIMESTAMP | |
| entry_created_by | int(11) | YES | | NULL | |
| entry_modified_by | int(11) | YES | | NULL | |
| entry_basename | varchar(255) | YES | MUL | NULL | |
| entry_atom_id | varchar(255) | YES | | NULL | |
| entry_week_number | int(11) | YES | MUL | NULL | |
+----------------------+--------------+------+-----+-------------------+----------------+
23 rows in set (0.00 sec)
mysql> select entry_allow_pings,count(*) from mt_entry group by entry_allow_pings;
+-------------------+----------+
| entry_allow_pings | count(*) |
+-------------------+----------+
| 0 | 38 |
| 1 | 1276 |
+-------------------+----------+
2 rows in set (0.00 sec)
mysql> update mt_entry set entry_allow_pings = 0
-> where entry_allow_pings <> 0;
Query OK, 1276 rows affected (0.38 sec)
Rows matched: 1276 Changed: 1276 Warnings: 0
mysql> select entry_allow_pings,count(*) from mt_entry group by entry_allow_pings;
+-------------------+----------+
| entry_allow_pings | count(*) |
+-------------------+----------+
| 0 | 1314 |
+-------------------+----------+
1 row in set (0.00 sec)
mysql>
Posted by Rob Kiser on August 19, 2007 at 10:18 AM
Comments
worked like a charm.
Posted by: sl on August 19, 2007 at 2:09 PM