Mysql Backup Restore does not insert all Tables

Asked

Viewed 400 times

2

I have a database MySql, where I performed a backup of all data from a given database (all data within a file has actually been saved .sql) but when I was reset using this file was not inserted all tables of the database (Total 18, Inserted 14)

Questions:

  1. What Real Reason For This Problem ?
  2. How to solve ?

Obs1: I noticed that it was saved the tables in alphabetical order soon I could notice a mismatch of Primary and Foreign Keys (Insertion of foreigners before foreign keys) (Possible problem)

Obs2: Mysql dump 10.13 Distrib 5.6.21, for Win32 (x86), Innodb

  • This has already happened to me, however, I was using postgresSQL , I had made some changes in the backup configuration and forgot to return to the normal state of the bank. I just decided to remove the bank and reinstall it! But my luck is that it had other backups!! You just made a single backup?

  • @Penapintada yes this is the only Backup (has all tables only at insert time does not insert all)

  • Unless mistaken, the Mysql dump , without extra parameters does not lock the accesses to the tables, and may generate lack of integrity between them if you have application accessing the database. If this SQL file is the only thing you have now, I suggest you edit it, comment/remove all constraints manually and try to load it... if you load it, then the problem really is the lack of integrity. I also suggest taking a look at the file contents to see if the "missing" tables are really there.

1 answer

2


If the file in question is not damaged and the error is only (Primary and Foreign Keys), just perform this procedure in the backup file:

1 After the command use bancodedados; put the command

SET FOREIGN_KEY_CHECKS = 0;

to deactivate the keys, having done the injection at the end put the following command at the end of the script to reactivate the keys

SET FOREIGN_KEY_CHECKS = 1;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.