Find and replace entire mysql database

后端 未结 12 2181
走了就别回头了
走了就别回头了 2020-11-27 13:16

i would like to do a find and replace inside an entire database not just a table.

How can i alter the script below to work?

 update [table_name] set          


        
12条回答
  •  感动是毒
    2020-11-27 14:04

    sqldump to a text file, find/replace, re-import the sqldump.

    Dump the database to a text file
    mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql

    Restore the database after you have made changes to it.
    mysql -u root -p[root_password] [database_name] < dumpfilename.sql

提交回复
热议问题