sql - mysql: change http://old-domain.com to http://new-domain.com in all tables -
I am using the statement from here:
But I had to modify them because I am using multi-user and have a separate table structure (strange numbered tables). As you can see that this is all very problematic ... So my question is:
Do I to everywhere ... Can I change the table in that database? How can I find such a way and change with mysql? Or maybe something better for this job?
You can dump the entire db into a SQL file and replace it and import it back.
You can use the mysqldump command to dump the SBL file, or you can still use phpmyadmin
mysqldump --opt - UUSERNAME -pPASSWORD -H MYSQLDOMAIN YOURDB & gt; ; Yourdbdump.sql
You can do this to change the text in the .sql file
sed -ie / old-domain.com / new- Domain .com / g 'yourdbdump.sql
to restore it back
mysql -uUSERNAME -pPASSWORD -H MYSQLDOMAIN YOURDB & lt; Yourdbdump.sql
Comments
Post a Comment