i am using ubuntu 16.04 and want to dump large schema with hounded of tables from AWS rds, remove all keys and foreign key , load data and then add back the keys , is there any automatic tool that does this? or any well known script for this ? i am currently using mysqldump https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html with this command :

mysqldump --skip-triggers --compact --no-create-info --single-transaction --quick --max_allowed_packet 1G  -h host_name.rds.amazonaws.com -u <user> -P 3306 -p<pwd> <schema> {table_name}> /mnt/tables_just_data/{table_name}.sql
  • 1
    I wonder why? mysqldump already creates statements that disable foreign key checks and indexes during loading. – tombom Apr 23 at 14:24
  • This might be of use! – Vérace Apr 23 at 15:40
  • @tombom the ALTER TABLE ... DISABLE KEYS statements emitted by mysqldump are applicable only to MyISAM tables. InnoDB ignores them. Disabling foreign key checks does prevent FK constraint validation, but the indexes are still built as the rows are inserted. – Michael - sqlbot Apr 23 at 17:12
  • You are write disable keys are only for myisam tables I am using innoDB – junior_software Apr 23 at 19:09
  • Please explain what your ultimate goal is; there may be a different way to do it. – Rick James Apr 29 at 0:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.