Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I need to run a query to find and replace some text in all tables of a mysql database.

I found this query, but it only looks for the text in the tbl_name table and just in the column field.

update tbl_name set column=REPLACE(column, 'fuschia', 'fuchsia'); 

I need it to look in all tables and all fields: (everywhere in the database)

share|improve this question
You can get an idea here –  dezso Jul 19 '12 at 12:30
This is a bit strange though, can you elaborate as why you need to do this, I am only curious. –  Emmad Kareem Jul 19 '12 at 12:57
Then I have to loop every table. Thanks, I get it done. @dezco: would you mind to change your comment to an answer so that I can accept it. –  chefnelone Jul 19 '12 at 14:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.