<p>Based on that description, my guess is you're running into #2 here (<a href="https://stackoverflow.com/a/16969176/684">https://stackoverflow.com/a/16969176/684</a>) and you've got some inconsistent data in one of the three foreign key constraints that the SQL is trying to add.</p>

CC BY-SA 3.0
2017-05-04T08:58:30.653Z
Ok, how might I go about sorting that out? I uploaded the same DB to another host and it was fine.
sarah3585
CC BY-SA 3.0
2017-05-03T18:05:24.653Z
2017-05-03T18:05:24.653Z
2017-05-23T12:38:53.957Z
Brad Bell
<p>I'm uploading a site to a new environment and getting the following error:</p>

<p><a href="https://i.sstatic.net/LGAYO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/LGAYO.png" alt="error message"></a></p>

<p><strong>The assetfiles table structure:</strong>
<a href="https://i.sstatic.net/vrlLo.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/vrlLo.png" alt="The assetfiles table structure"></a></p>

<error-message><mysql>
SQL Error - cannot add foreign key constraints
# SQL Error - cannot add foreign key constraints

(Asked by: username_0 on 2017-05-03)

I'm uploading a site to a new environment and getting the following error:

[![error message](https://i.sstatic.net/LGAYO.png)](https://i.sstatic.net/LGAYO.png)

**The assetfiles table structure:**
[![The assetfiles table structure](https://i.sstatic.net/vrlLo.png)](https://i.sstatic.net/vrlLo.png)

**Tags:** error-message, mysql


---

## 1 answers

### Answer by username_1 on 2017-05-03. Score: 1

Based on that description, my guess is you're running into #2 here (<https://stackoverflow.com/a/16969176/684>) and you've got some inconsistent data in one of the three foreign key constraints that the SQL is trying to add.

> **Comments:**
> **username_0**: Ok, how might I go about sorting that out? I uploaded the same DB to another host and it was fine.  

---

