posts – MYSQL: Create SQL query to search for string and replace

I need to delete a malicious string from 2176 fields following a url redirect hack. I’m pretty vanilla at SQL so some help is much appreciated. I have MYSQL ClI or PHPmyAdmin available to me.

The details are

  • Database is: WordPress
  • Table is: wp_posts
  • Column is: post_content
  • string is: <script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script><script src='https://https://xyz/js.php?s=q' type='text/javascript'></script>

What would the correct REPLACE query be to find this string and repalce it with blank. I cannot just empty the field because sometimes there is a value in the field that is legitmate.