LMSouq
moodle-core Open

How can I replace a string in a MySQL database for all tables in all fields in all rows?

CO
Community Contributor
1 month ago
3 views
Problem Description
I have a Moodle installation that I migrated to another server and I need to change several references to the old domain. How can I replace a string for another string in MySQL for a given database **searching all tables, all fields, and all rows?** I don't need to change the field names, just the values. --- Related: https://stackoverflow.com/questions/4271186/how-can-i-use-mysql-replace-to-replace-strings-in-multiple-records 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.

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base