# Fehler bei Installation: Foreign key constraint is incorrectly formed

**URL:** <https://forum.shopware.com/t/fehler-bei-installation-foreign-key-constraint-is-incorrectly-formed/60896>\
**Category:** Installation / Einstieg\
**Created:** [6. August 2019 um 14:39 UTC](https://forum.shopware.com/t/fehler-bei-installation-foreign-key-constraint-is-incorrectly-formed/60896 "2019-08-06T14:39:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gan](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gan](https://forum.shopware.com/u/gan)\
**Post date:** [6. August 2019 um 14:39 UTC](https://forum.shopware.com/t/fehler-bei-installation-foreign-key-constraint-is-incorrectly-formed/60896/1 "2019-08-06T14:39:06Z")

</div>

Hallo Zusammen

Beim Installationsabschnitt&nbsp;„Installation“ (Schritt&nbsp;70&nbsp;von&nbsp;250) bekomme ich immer folgenden Fehler:

&nbsp;

```
Error
Received an error message.
URL: importDatabase
Message: 

Please try to fix this error and restart the update.
Response
{"valid":false,"errorMsg":"An exception occurred while executing '\n CREATE TABLE `custom_field` (\n `id` BINARY(16) NOT NULL PRIMARY KEY,\n `name` VARCHAR(255) NOT NULL,\n `type` VARCHAR(255) NOT NULL,\n `config` JSON NULL,\n `active` TINYINT(1) NOT NULL DEFAULT 1,\n `set_id` BINARY(16) NULL,\n `created_at` DATETIME(3) NOT NULL,\n `updated_at` DATETIME(3) NULL,\n CONSTRAINT `uniq.custom_field.name` UNIQUE (`name`),\n CONSTRAINT `json.custom_field.config` CHECK(JSON_VALID(`config`)),\n CONSTRAINT `fk.custom_field.set_id` FOREIGN KEY (set_id)\n REFERENCES `custom_field_set` (id) ON UPDATE CASCADE ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;\n ':\n\nSQLSTATE[HY000]: General error: 1005 Can't create table `web0230_shop`.`custom_field` (errno: 150 \"Foreign key constraint is incorrectly formed\")"}

```

&nbsp;

Merkwürdigerweise&nbsp;geht es, wenn ich SW6&nbsp;lokal auf XAMP installiere.&nbsp;Auf dem Webserver will es aber nicht.

Danke & Gruß  
Gan

---

<div class="post-metadata">

**Author:** ![gan](https://avatars.discourse-cdn.com/v4/letter/g/b19c9b/32.png) [@gan](https://forum.shopware.com/u/gan)\
**Post date:** [6. August 2019 um 14:45 UTC](https://forum.shopware.com/t/fehler-bei-installation-foreign-key-constraint-is-incorrectly-formed/60896/2 "2019-08-06T14:45:54Z")

</div>

Habe die Lösung in einem anderen Post mit dem gleichen Problem gefunden. Einfach dieser Anleitung folgen:&nbsp;[https://issues.shopware.com/issues/NEXT-4072](https://issues.shopware.com/issues/NEXT-4072)
