I am trying to install Zabbix by following this guide. I ran into the following problems when trying to run data.sql after running scheme.sql successfully

mysql -D zabbix -uzabbix -pPassword < /home/zabbix/zabbix-2.4.5/database/mysql/schema.sql

mysql -D zabbix -uzabbix -pPassword < /home/zabbix/zabbix-2.4.5/database/mysql/data.sql

ERROR 1452 (23000) at line 2989: Cannot add or update a child row: a foreign key constraint fails ('zabbix'.'sysmaps_elements', CONSTRAINT 'c_sysmaps_elements_2' FOREIGN KEY ('iconid_off') REFERENCES 'images' ('imageid'))

I cannot figure out why I would not be able to add or update a child row , it looks perfectly fine to me.

The scripts can be downloaded from here

  • So iconid_off in all rows being inserted to sysmaps_elements already exists as a value for imageid in images? The script should be inserting in that order. What does line 2989 of the script contain? – dartonw May 3 '15 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.