Error
Error Code: 1173

MariaDB Error 1173: Table Type Requires Primary Key

📦 MariaDB
📋

Description

MariaDB error 1173 indicates that the specific table type or storage engine you are attempting to use requires a primary key to be defined. This error typically occurs during table creation or alteration when the SQL statement omits a PRIMARY KEY definition for an engine that mandates it.
💬

Error Message

This table type requires a primary key
🔍

Known Causes

3 known causes
⚠️
NDBCLUSTER Engine Requirement
The NDBCLUSTER storage engine, used for MariaDB Cluster (formerly MySQL Cluster), strictly enforces the presence of a primary key for every table.
⚠️
Missing PRIMARY KEY Clause
The `CREATE TABLE` or `ALTER TABLE` statement did not include an explicit definition for a PRIMARY KEY, which is mandatory for the chosen storage engine or table configuration.
⚠️
Storage Engine Configuration
While not always strictly enforced by default, certain configurations or use cases for engines like InnoDB or MyISAM might implicitly or explicitly require a primary key for optimal operation or data integrity.
🛠️

Solutions

Coming Soon

Detailed step-by-step solutions for this error are being prepared. In the meantime, try these general troubleshooting tips:

General Troubleshooting Tips

  • Check the error message carefully for specific details
  • Review recent changes that might have caused the error
  • Search for the exact error code in the official documentation
  • Check log files for additional context
  • Try restarting the application or service
🔗

Related Errors

5 related errors