title: How can I replace a string in a MySQL database for all tables in all fields in all rows?
body: <p>I have a Moodle installation that I migrated to another server and I need to change several references to the old domain.</p>
  
  <p>How can I replace a string for another string in MySQL for a given database <strong>searching all tables, all fields, and all rows?</strong></p>
  
  <p>I don't need to change the field names, just the values.</p>
  
  <hr>
  
  <p>Related: <a href="https://stackoverflow.com/questions/4271186/how-can-i-use-mysql-replace-to-replace-strings-in-multiple-records">How can I use mySQL replace() to replace strings in multiple records?</a></p>
  
  <p>But the marked as answer solution implies I strongly type the table name and I need to fire this into an entire database, not manually work on each table running the script N times.</p>