/ Gists / Replace text in all string columns of a database
On gists

Replace text in all string columns of a database

MySql

Replace text in all string colum Raw #

Select Concat( 'update ', table_schema, '.', table_name,
               ' set ', column_name,
               '=replace(', column_name, ',''old_text'',''new_text'');'
             )
From information_schema.columns
Where (data_type Like '%char%' or data_type like '%text' or data_type like '%binary')
  And table_schema = 'dbname';