Just because someone asked, here’s a quick way to find and replace content in MySQL using PHPmyAdmin. This technique works the same command line, and it’s possible it works similar in applications such as Navicat, but I have little experience in GUI tools. To manage:
- Login to PHPmyAdmin
- Select the database you want in the left frame, if you have multiple
- Choose the ‘SQL’ tab in the right frame
- Add the following code and update
UPDATE `table` SET tablefield = replace(tablefield,"your mom","my mom");
Replace table with the name of your table, the tablefield with the title of the tablefield you want to search, the first value (your mom) will be replaced by the second (my mom). In my case, I zapped gremlins for emdash in a standard wordpress 2.5 upgrade:
UPDATE `wp_posts` SET post_content = replace(post_content,"â","—");