Mass Replace String in MySQL Database
Problem:
I want to change url path or a string from mysql table.
I want to change url path or a string from mysql table.
Solution:
Do it manually? No way. There are hundreds of them!
There are basically two ways -
First, output the database table and use text editor's "search and replace" function.
Second, use MySQL REPLACE function.
Here is the SQL query to replace string in database table:-
UPDATE table_name SET column_name = REPLACE(column_name,"original_string","replace_string");
Comments
Post a Comment