[ZBX-4678] Need disable check foreign keys for new installation Created: 2012 Feb 20  Updated: 2017 May 30  Resolved: 2012 Feb 20

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Installation (I)
Affects Version/s: 2.0.0rc1
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Alexey Pustovalov Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

only MySQL!!! new installation. rev 25485.


Issue Links:
Duplicate
duplicates ZBX-3020 Cannot fill new DB with data.sql (tr... Closed

 Description   

we was load data.sql, after load schema.sql into mysql database, and get error (images.sql had not been imported yet!! ):
localhost zabbix-trunk # cat database/mysql/data.sql | mysql -pQwestions zbx_trunk
ERROR 1452 (23000) at line 12049: Cannot add or update a child row: a foreign key constraint fails (`zbx_trunk`.`sysmaps_elements`, CONSTRAINT `c_sysmaps_elements_2` FOREIGN KEY (`iconid_off`) REFERENCES `images` (`imageid`))

because some records (inserted rows) have constraint keys. Need to add next rows:
SET foreign_key_checks = 0; in the begin
and
SET foreign_key_checks = 1; in the end

I think need consider this factor.



 Comments   
Comment by Alexey Pustovalov [ 2012 Feb 20 ]

in manual images need load to mysql before data!

Generated at Sat Aug 02 10:25:41 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.