metricsign
Start free
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

  1. 1Step 1: Run `SHOW ENGINE INNODB STATUS;` immediately after the error to get the detailed FK failure reason.
  2. 2Step 2: Add an index to the referenced parent column: `ALTER TABLE parent ADD INDEX (referenced_col);`
  3. 3Step 3: Ensure FK and referenced column types match exactly (INT vs INT, not INT vs BIGINT).
  4. 4Step 4: Check disk space: `df -h` — InnoDB cannot create tables if disk is full.

Frequently asked questions

What does errno 150 mean in MySQL error 1005?

Errno 150 specifically means a foreign key constraint failed. Run `SHOW ENGINE INNODB STATUS;` and look for the LATEST FOREIGN KEY ERROR section for the specific cause.

How do I debug MySQL error 1005 without SHOW ENGINE INNODB STATUS?

Enable the InnoDB monitor: `SET GLOBAL innodb_status_output=ON;` — MySQL will write detailed InnoDB status to the error log every 15 seconds.

Can MetricSign alert me when a schema migration creates this error?

Yes — MetricSign surfaces dbt job failures and ADF pipeline failures with the MySQL error code, giving you immediate visibility into migration issues.

Official documentation: https://dev.mysql.com/doc/mysql-errors/8.0/en/server-error-reference.html

Other schema errors