[Snippet] How to Search and Replace String in MySQL or PHPMyAdmin

Friday, April 10th, 2015 - Code Snippet

Imagine, you have a 10K records in a table in your database. And on each line, there is a character that you want to remove or replaced with other characters. If do it manually, it may take days. Creating a system or script to solve the problem it was still takes a lot of times.

I have even had a case like this and I am looking on the internet. Turns out there and very simple. MySQL has a replace function similar to PHP. Just use this in phpmyadmin  and all your problems will be completed.

UPDATE `table`
SET `field` = replace(field, 'unwanted_char', 'wanted_char')

Problems are solved in seconds… very help me.

[Snippet] How to Search and Replace String in MySQL or PHPMyAdmin | Fareed Abdullah | 4.5