.: ShaolinTiger – Kung-Fu Geekery :.

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.

phpMyAdmin SQL MySQL

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

phpMyAdmin SQL MySQL

At the top left you can then select your database.

phpMyAdmin SQL MySQL

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

phpMyAdmin SQL MySQL

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: , , , , ,

Follow @ShaolinTiger on Twitter Follow me on Twitter Follow @ShaolinTiger on Twitter Subscribe to RSS Subscribe to RSS Subscribe to RSS

                

Posted in Internet & Tech | 4 comments -

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!
- WordPress Back To Default Install State – wp_options Table Corrupted
- Spoiler OFF
- Damnit – No more updates for the moment!

4 Comments so far

  1. Paul Tan  on January 17th, 2006 at 3:13 pm
    Using Mozilla Firefox Mozilla Firefox 1.5 on Windows Windows XP 

    good tip

  2. spiller  on January 17th, 2006 at 4:39 pm
    Using Internet Explorer Internet Explorer 6.0 on Windows Windows XP 

    how much i owe u? can i buy u beer instead? =P

  3. ShaolinTiger  on January 17th, 2006 at 4:51 pm
    Using Mozilla Firefox Mozilla Firefox 1.5 on Windows Windows XP 

    spliller: Beer, Liquor, nice seafood makan..I accept them all!

  4. nospam  on March 2nd, 2011 at 1:48 pm
    Using Mozilla Firefox Mozilla Firefox 3.6.13 on Ubuntu Linux Ubuntu Linux 

    gosh, you can do without all the annoying distortion of the images

Leave a reply