Have you ever wished you didn’t have comments and pings turned on for your WordPress blog, but editing each post and page to un-check those boxes just took too long? Here are a couple of mysql statements you can use to turn them all off at once.
update wp_posts set `comment_status` = ‘closed’ where (`comment_status` = ‘open’)
update wp_posts set `ping_status` = ‘closed’ where (`ping_status` = ‘open’)