PHP Classes

test with mariadb

Recommend this page to a friend!

      Danen MySQL Backup  >  All threads  >  test with mariadb  >  (Un) Subscribe thread alerts  
Subject:test with mariadb
Summary:restore problem
Messages:4
Author:Kakhaber Kashmadze
Date:2015-03-10 15:48:51
 

  1. test with mariadb   Reply   Report abuse  
Picture of Kakhaber Kashmadze Kakhaber Kashmadze - 2015-03-10 15:48:51
I am usng mariadb on fedora and
dumping file there was message that
Created: test.sql.gz

but when restoring with phpmyadmin or from commandline message is:

ERROR 1217 (23000) at line 17: Cannot delete or update a parent row: a foreign key constraint fails

Is this issue with mariadb or also with mysql?

  2. Re: test with mariadb   Reply   Report abuse  
Picture of Gerry Danen Gerry Danen - 2015-03-10 15:53:13 - In reply to message 1 from Kakhaber Kashmadze
That is a foreign key problem.

  3. Re: test with mariadb   Reply   Report abuse  
Picture of Kakhaber Kashmadze Kakhaber Kashmadze - 2015-03-11 22:20:53 - In reply to message 2 from Gerry Danen
So this class doen not works with foreign keys?

  4. Re: test with mariadb   Reply   Report abuse  
Picture of Alejandro Estévez Rodríguez Alejandro Estévez Rodríguez - 2016-10-26 13:04:27 - In reply to message 3 from Kakhaber Kashmadze
SOLUTION:

add to line 94

-- Disabled Foreign Keys
SET FOREIGN_KEY_CHECKS = 0;



replace line 233 with:

$this->backupDump .= <<< EOT

-- Enabled Foreign Keys
SET FOREIGN_KEY_CHECKS = 1;
\n\n-- End of backup\n
EOT;