alyasabrina alyasabrina - 2 years ago 158
SQL Question

Find and Replace text in all table using mysql query

Usually I use manual find to replace text in mysql database using phpmyadmin, and im tired now, how to run query find and replace that search all table and replace with new text in phpmyadmin.

example : find keyword, replace with


Answer Source

For a single table update

 UPDATE `table_name`
 SET `field_name` = replace(same_field_name, 'unwanted_text', 'wanted_text')

From multiple tables-

If you want to edit from all tables, best way is to take the dump and then find/replace and upload it back.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download