# zabbix installation problem - ERROR 1452 (23000) at line 122

## rado3105

```
gentoo-desktop ~ # mysql -u zabbix -p zabbix < /usr/share/zabbix/database/create/data/data.sql

Enter password: 

ERROR 1452 (23000) at line 12215: 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`))
```

Can anybody know how to solve it?

Edit: Seems like zabbix bug: https://support.zabbix.com/browse/ZBX-3020

----------

## rado3105

using this manual for 1.9x versions:

http://en.gentoo-wiki.com/wiki/Zabbix

```
mysql -uzabbix -p zabbix < /usr/share/zabbix/database/create/schema/mysql.sql

mysql -uzabbix -p zabbix < /usr/share/zabbix/database/create/data/data.sql

mysql -uzabbix -p zabbix < /usr/share/zabbix/database/create/data/images_mysql.sql
```

there is mistake it should be all 3 

```
-uzabbix
```

 separated like this: 

```
-u zabbix
```

.

another mistake: 

```
mysql -u zabbix -p zabbix < /usr/share/zabbix/database/create/data/images_mysql.sql
```

 should be executed before 

```
mysql -u zabbix -p zabbix < /usr/share/zabbix/database/create/data/data.sql
```

 be careful of this. This was the problem that showed me.

Then when I did it it showed me error: 

```
ERROR 1062 (23000) at line 24: Duplicate entry '1' for key 'PRIMARY'
```

but it should be ok, or?

----------

