Quicktip: Find and replace data in MySQL

In case you need to replace a string in a certain field in MySQL use this small snippet:

This comes e.g. handy when you want to replace the “[Translate to …]” prefixes in TYPO3 CMS, which are prepended to the header and bodytext fields when translating content elements in the backend (unless you haven’t turned this behavior off).

The following will replace all occurrences of “[Translate to Norge:] ” in the header field with an empty string:

And the same for the bodytext field:

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">