Online Tutorials & Training Materials | STechies.com
Register Login

Find and replace text in field with MySQL Query

|| || 0

Find and replace text in field with MySQL Query
Stechies

This you can do it by using simple REPLACE() function of mysql

To replace text from single Table

update user_table set user_name = replace(user_name, 'Old Name', 'New Name');

Multiple Table

Dump database to text file

mysqldump -uuser -ppassword databasename > filename.sql

Find and replace by sed cmd

sed -i '/oldtext new/' filename.sql

Upload back database

mysql -uuser -ppassword databasename < filename.sql

 


Related Articles