If it's still possible, dump the data structures in sql and the data tables in csv format using mysqldump --tab=path
. This way, any modifications you will need to do will be on the much smaller sql file, keeping the large data files untouched. They you could later import the whole thing using mysqlimport
command.
Alternatively, you could always use the mysql --force
option for importing your sql file.
More information:
- MySQL Reference Manual: mysqldump --tab=path option
- MySQL Reference Manual: mysqlimport
- MySQL Reference Manual: mysql --force
For manually editing the files:
If you are using Linux as your operating system, then there is a big variety of commands in your hand: more
, less
, sed
, etc. sed
is good for substitutions, similar to your question. A nice tutorial can be found at http://www.grymoire.com/Unix/Sed.html
In Windows, I sometimes use PowerShell. I had similar post on StackOverflow about "mysqldump without database name" where there is an example of how to replace a string in a dump file.