We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing exported database on the exact same mysql database via danpu Export,
following exception thrown
Caught exception: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
The text was updated successfully, but these errors were encountered:
You can resolve this error by disabling the foreign and unique key checks in the Dump instance while exporting the database.
$dump = new Dump; $dump ->disableForeignKeyChecks(true) ->disableUniqueKeyChecks(true) ->file("database.sql") ->dsn($DSN) ->user($DATABASE_USER) ->pass($DATABASE_PASS) ->tmp("path/to/temp");
$dump = new Dump;
$dump ->disableForeignKeyChecks(true) ->disableUniqueKeyChecks(true) ->file("database.sql") ->dsn($DSN) ->user($DATABASE_USER) ->pass($DATABASE_PASS) ->tmp("path/to/temp");
Sorry, something went wrong.
You could also try to import table in a different order to see if this error doesn't happen.
No branches or pull requests
Importing exported database on the exact same mysql database via danpu Export,
following exception thrown
Caught exception: SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint
The text was updated successfully, but these errors were encountered: