MySQL - How to find and replace text as a part of a string?
Try this query:
UPDATE table_name SET column_name = REPLACE(column_name, 'text to find', 'text to replace with') WHERE column_name LIKE '%text to find%';
You have table
profile with one column
profile_url containing these urls:
https://facebook.com/a https://facebook.com/aa https://facebook.com/aaa https://facebook.com/aaaa https://facebook.com/aaaaa
And you want to replace
UPDATE profile SET profile_url = REPLACE(profile_url, 'facebook.com', 'instagram.com') WHERE profile_url LIKE '%facebook.com%';
Need a good GUI Tool for MySQL? TablePlus is a modern, native tool with an elegant UI that allows you to simultaneously manage multiple databases such as MySQL, PostgreSQL, SQLite, Microsoft SQL Server and more.