Ad Widget

Collapse

database upgrade 3.0.x to 4.4 Mysql errors

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klarter
    Junior Member
    • Jul 2020
    • 27

    #1

    database upgrade 3.0.x to 4.4 Mysql errors

    Initial try at upgrade caused SQL errors.
    Manually dropped several tables
    Finally, I am stuck here:
    [Z3005] query failed: [1005] Can't create table `zabbix`.`corr_condition_tag` (errno: 150 "Foreign key constraint is incorrectly formed") [alter table `corr_condition_tag` add constraint c_corr_condition_tag_1 foreign key (`corr_conditionid`) references `corr_condition` (`corr_conditionid`) on delete cascade]
  • klarter
    Junior Member
    • Jul 2020
    • 27

    #2
    Finally a good restore of the old database. Now I am back to first error message I got trying to upgrade. Which is:
    Can't drop FOREIGN KEY 'c_sessions_1'

    Comment

    • klarter
      Junior Member
      • Jul 2020
      • 27

      #3
      The old db has no such foreign key. Show create table for sessions is:
      CREATE TABLE `sessions` (
      `sessionid` varchar(32) COLLATE utf8_bin NOT NULL DEFAULT '',
      `userid` bigint(20) unsigned NOT NULL,
      `lastaccess` int(11) NOT NULL DEFAULT 0,
      `status` int(11) NOT NULL DEFAULT 0,
      PRIMARY KEY (`sessionid`),
      KEY `sessions_1` (`userid`,`status`)
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |

      Comment

      • tim.mooney
        Senior Member
        • Dec 2012
        • 1427

        #4
        Did you start using Zabbix at an earlier version, and upgrade it (possibly multiple times) to get to 3.0?

        I've posted on these forums before about some of the things I did to "clean up" schema inconsistencies in my Zabbix database to prepare for Zabbix 5.x. One of the threads with links to some of the posts is here: https://www.zabbix.com/forum/zabbix-...ariadb-upgrade

        Comment

        • klarter
          Junior Member
          • Jul 2020
          • 27

          #5
          Thanks, Tim
          Started with brand new zabbix 3.0 in August, this year. No manual changes made.
          Looks like a difficult process ahead.

          Comment

          Working...