I had the same issue on MySQL. I took the procedure from symcbean and adapted her to my needs.
Mine is only replacing textual values (or any type you put in the SELECT FROM information_schema) so if you have date fields, you will not have an error in execution.
Mind the collate in SET @stmt, it must match you database collation.
I used a template request in a variable with multiple replaces but if you have motivation, you could have done it with one CONCAT().
Anyway, if you have serialized data in your database, don't use this. It will not work unless you replace your string with a string with the same lenght.
Hope it helps someone.
DELIMITER $$
DROP PROCEDURE IF EXISTS replace_all_occurences_in_database$$
CREATE PROCEDURE replace_all_occurences_in_database (find_string varchar(255), replace_string varchar(255))
BEGIN
DECLARE loop_done integer DEFAULT 0;
DECLARE current_table varchar(255);
DECLARE current_column varchar(255);
DECLARE all_columns CURSOR FOR
SELECT
t.table_name,
c.column_name
FROM information_schema.tables t,
information_schema.columns c
WHERE t.table_schema = DATABASE()
AND c.table_schema = DATABASE()
AND t.table_name = c.table_name
AND c.DATA_TYPE IN('varchar', 'text', 'longtext');
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET loop_done = 1;
OPEN all_columns;
table_loop:
LOOP
FETCH all_columns INTO current_table, current_column;
IF (loop_done > 0) THEN
LEAVE table_loop;
END IF;
SET @stmt = 'UPDATE `|table|` SET `|column|` = REPLACE(`|column|`, "|find|", "|replace|") WHERE `|column|` LIKE "%|find|%"' COLLATE `utf8mb4_unicode_ci`;
SET @stmt = REPLACE(@stmt, '|table|', current_table);
SET @stmt = REPLACE(@stmt, '|column|', current_column);
SET @stmt = REPLACE(@stmt, '|find|', find_string);
SET @stmt = REPLACE(@stmt, '|replace|', replace_string);
PREPARE s1 FROM @stmt;
EXECUTE s1;
DEALLOCATE PREPARE s1;
END LOOP;
END
$$
DELIMITER ;