MySQL replace statement

How can I search and replace within MySQL/MariaDB?

UPDATE table_name
SET table_field = REPLACE(table_field, 'find this string', 'replace with this string')
WHERE table_field LIKE '%find this string%'

htaccess – Redirect while removing query parameter

The parameter being removed in this example is ‘qwerty’ with up to 5 numeric digits afterwards.

RewriteCond %{QUERY_STRING} qwerty=[0-9]{1,5} [NC]
RewriteRule (.*)$1? [R=301,L]

The question mark in the RewriteRule is what tells Apache to not include the query parameter during the rewrite.