SQL upgrade issue

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
eventhorizon5
Posts: 7
Joined: Wed Mar 21, 2007 11:00 pm

SQL upgrade issue

Post by eventhorizon5 »

When upgrading a Cacti installation from 1.0.6 to 1.1.25, I encountered these SQL failures:

----------------------
[Fail]
ALTER TABLE snmpagent_cache_notifications
MODIFY COLUMN `name` VARCHAR(50) NOT NULL,
MODIFY COLUMN `mib` VARCHAR(50) NOT NULL,
MODIFY COLUMN `attribute` VARCHAR(50) NOT NULL,
ADD PRIMARY KEY (`name`,`mib`,`attribute`,`sequence_id`)
(ERROR 1068 (42000): Multiple primary key defined)

[Fail]
ALTER TABLE snmpagent_cache_textual_conventions
MODIFY COLUMN name VARCHAR(50) NOT NULL,
MODIFY COLUMN mib VARCHAR(50) NOT NULL,
MODIFY COLUMN type VARCHAR(50) NOT NULL,
ADD PRIMARY KEY (`name`,`mib`,`type`)
(ERROR 1068 (42000): Multiple primary key defined)

[Fail]
ALTER TABLE snmpagent_managers_notifications
MODIFY COLUMN `notification` VARCHAR(50) NOT NULL,
MODIFY COLUMN `mib` VARCHAR(50) NOT NULL,
ADD PRIMARY KEY (`manager_id`,`notification`,`mib`)
(ERROR 1068 (42000): Multiple primary key defined)
----------------------

I'm probably going to do a workaround to fix it, to remove the existing primary keys, but wanted to check on this forum first.
izmenoff
Posts: 19
Joined: Tue Mar 28, 2017 6:27 am
Location: Belarus

Re: SQL upgrade issue

Post by izmenoff »

You can try run from /cacti/cli
php repair_database.php
php upgrade_database.php
eventhorizon5
Posts: 7
Joined: Wed Mar 21, 2007 11:00 pm

Re: SQL upgrade issue

Post by eventhorizon5 »

izmenoff wrote:You can try run from /cacti/cli
php repair_database.php
php upgrade_database.php
That didn't help. I tried manually dropping the indexes and then re-running the commands, and that worked.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest