High severityschema
Power BI Refresh Error:
1005
What does this error mean?
CREATE TABLE failed — commonly due to an invalid foreign key definition, index issue, or permission problem. Check errno in the error message.
Common causes
- 1Foreign key references a column that does not have a matching index in the parent table
- 2FK column data types do not match between child and parent tables
- 3The table name conflicts with a reserved word or the disk is full
- 4InnoDB tablespace is corrupted or the .ibd file already exists
How to fix it
- 1Step 1: Run `SHOW ENGINE INNODB STATUS;` immediately after the error to get the detailed FK failure reason.
- 2Step 2: Add an index to the referenced parent column: `ALTER TABLE parent ADD INDEX (referenced_col);`
- 3Step 3: Ensure FK and referenced column types match exactly (INT vs INT, not INT vs BIGINT).
- 4Step 4: Check disk space: `df -h` — InnoDB cannot create tables if disk is full.
Frequently asked questions
Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html