Some encountered errors
ERROR 1215 …
Some encountered errors
ERROR 1215 (HY000): Cannot add foreign key constraint
- in mysql shell:
SET GLOBAL FOREIGN_KEY_CHECKS = 0;
- in mysql => not worked
- add into backup.sql => not worked
- finally deleted the foreign key constraint line in
backup.sql
- in mysql shell:
ERROR 1367 (22007): Illegal double
$ replace 1.79769313486232e+308 \'1.79769313486232e+308\' -- backup.sql
can solve the problem (bug).
Backup
- On local server
mysqldump -f --all-databases --password='xxx' > /tmp/bakcup.sql
Use scp
or other command to transfter the backup.sql
to destination server
Restore
- On destination server
mysql -u user -p < /tmp/backup.sql
Use the Force
mysql --force -u user -p < /tmp/backup.sql
References
- Backup / Restore
- ERROR 1215 (HY000): Cannot add foreign key constraint
- http://forums.mysql.com/read.php?35,581311,581311#msg-581311
- http://stackoverflow.com/questions/16608042/error-1215-hy000-cannot-add-foreign-key-constraint
- http://stackoverflow.com/questions/18930084/mysql-error-1215-hy000-cannot-add-foreign-key-constraint
- http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html#sysvar_foreign_key_checks
- ERROR 1367 (22007): Illegal double
Share
Donation
如果覺得這篇文章對你有幫助, 除了留言讓我知道外, 或許也可以考慮請我喝杯咖啡, 不論金額多寡我都會非常感激且能鼓勵我繼續寫出對你有幫助的文章。
If this blog post happens to be helpful to you, besides of leaving a reply, you may consider buy me a cup of coffee to support me. It would help me write more articles helpful to you in the future and I would really appreciate it.
Related Posts
- Y2021W13
- Setup Static Ip Wired Network in Arch Linux
- Y2016W47
- Manage /etc/group and /etc/gshadow
- Y2017W35