How to Batch Replace String “aaa” with “bbb” in MySQL

 The images on my blog were originally hosted on thewww.s135.com server. Due to its instability, I moved all images to the blog.s135.com server and, in the MySQL database, performed a batch replacement to change the stringwww.s135.com to blog.s135.com. For future reference, I am recording the SQL statement for “batch-replace string aaa with bbb” here:

Quote
UPDATE table_name SET column_name = REPLACE (column_name, 'aaa', 'bbb');

Leave a Comment

Your email address will not be published.