Ad Widget

Collapse

Upgrade 1.8 to 2.0 mysql upgrade fail

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • clubbing80s
    Senior Member
    • Sep 2005
    • 109

    #1

    Upgrade 1.8 to 2.0 mysql upgrade fail

    When upgrading the mysql db I get the following error :

    Patching the database
    ERROR 1452 (23000) at line 104: Cannot add or update a child row: a foreign key constraint fails (`zabbix-1-8-6`.<result 2 when explaining filename '#sql-7ad_1b'>, CONSTRAINT `c_config_2` FOREIGN KEY (`discovery_groupid`) REFERENCES `groups` (`groupid`))
    Failed to patch Zabbix database. Restore from backup
    [root@nzhmlzab01 mysql]#
  • dougbee
    Member
    • Apr 2011
    • 68

    #2
    Others (including me) are getting this or a similar error:



    Should this be opened as a bug or multiple bugs? (Multiple because it seems as different foreign keys are failing)

    Comment

    • clubbing80s
      Senior Member
      • Sep 2005
      • 109

      #3
      RESOLVED: Upgrade 1.8 to 2.0 mysql upgrade fail

      Hi
      This worked for me.

      "
      You solve that, by editing the patch.sql script and change line 104 to 3 lines:
      SET foreign_key_checks=0;
      ALTER TABLE config ADD CONSTRAINT c_config_2 FOREIGN KEY
      (discovery_groupid) REFERENCES groups (groupid);
      SET foreign_key_checks=1;
      "
      Taken from the earlier mentioned link.
      Credit: groe0286

      Comment

      Working...