How to Find and Replace values in a database with MySQL?
1. Connect to your Database using the application of your choice. We will be using PHPMyAdmin for this tutorial.
Select your Table where you want to find and replace value in. In this example, we want to find and replace links that are not working properly in a table named wp_blc_links.
2. IMPORTANT: Backup the database and tables in question to avoid any loss of data!
3. Write down the name of the column in the table you would like to replace data in.
4. In this example, the name of the column is url.
5. Go ahead and click on SQL on the top
6. And type in the following SQL Query. Again MAKE SURE YOU HAVE A BACKUP OF YOUR DATABASE FIRST.
Our goal here was to replace within the tale named wp_blc_links and only in the column url any value that is equal to https://thinktutorial.com/smartphones/iphone/wp-content/uploads/ with https://thinktutorial.com/wp-content/uploads/
Copy/Paste it from here and modify it to fit your needs. Only replace the value in between [ … ]
UPDATE [table] set [columnname] = replace([columnname], ‘[replace this]’, ‘[with that]’);
7. Press “Go” to run the QUERY.
8. You are done!