Replace directly in SQL

Photo by Jan Antonin Kolar on Unsplash

There are thousands of cases where the replacement of a string by a new one in a mySQL database is necessary such as :

  • Switch to SSL with http:// replaced by https://
  • Change of domain name

I won't mention others, but I am sure you will find new ones.

In this kind of case it can be tedious to try to modify each link by hand, either by browsing your database or by using the editor of your CMS.

So this little SQL query will save the day very often.

 

Comments