I asked this question and I am just returning to the problem.
I have a backup script for my MySQL database using mysqldump with the --tab option, so it creates a .sql file for the structure and a .txt file (pipe split) for the content.
The answer to a related question works when importing SQL files (table structure), but I also get a foreign key constraint error when importing some tables (since the table has a foreign key for itself). These two teams:
cat <(echo "SET FOREIGN_KEY_CHECKS=0;") "table.sql" | mysql [user/pass] database mysqlimport [user/pass] --local --fields-terminated-by="|" database "table.txt"
It seems that this was requested a few years ago on its bug tracker , but was never implemented. Is there any way around this?
Please note that I want to continue using the tab option for various reasons (it is faster and works better with git, since each line is on a separate line).
source share