Search/Find and Replace Using phpMyAdmin and MySQL
I've had to do this quite a few times lately seen as though I moved from bBlog to Wordpress, there were some things I wanted to change, for example all posts that references /contact.php I wanted to change to /contact/ to fit the new permalink structure.
So for example in that case go to Cpanel (assuming you are using it) which will give you access to phpMyAdmin.
First you need to login to Cpanel with the username/password provided to you by your host, following that find the MySQL Databases link and click that.

Then at the bottom you'll see a link to phpMyAdmin, this is a web based management system for MySQL databases.

At the top left you can then select your database.

After that click the small SQL icon and a window should pop-up like this:

There you can enter your SQL statement.
To update something it's in the form of:
update table_name set field_name = replace(field_name,'replace_this','with_this');
So the example I used above for Wordpress would be:
update wp_posts set post_content = replace(post_content,'/contact.php','/contact/');
Pretty useful for general housekeeping or during a conversion/update.
Tags: mysql, mysql-tip, php, phpmyadmin, search-and-replace, wordpressPosted in Internet & Tech | -
Related Posts:
- Did Your Coppermine Gallery (CPG) Get Spammed? Eww Spam..
- Combating Spam - Disable Trackbacks for Older Posts in Wordpress
- Window Replaced… Choice Made.. More Travel!
- Damnit - No more updates for the moment!
- Argh - The Pain!
- I HATE Plaza Damas
3 Comments so far
Leave a reply















Using
good tip
Using
how much i owe u? can i buy u beer instead? =P
Using
spliller: Beer, Liquor, nice seafood makan..I accept them all!