This works:
CREATE TABLE shoutbox_shout (
shout_id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_id INT UNSIGNED NOT NULL DEFAULT 0,
shout_date INT UNSIGNED NOT NULL DEFAULT 0,
message MEDIUMTEXT NOT NULL,
KEY shout_date (shout_date)
)
...while this:
CREATE TABLE shoutbox_shout (
shout_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
user_id INT UNSIGNED NOT NULL DEFAULT 0,
shout_date INT UNSIGNED NOT NULL DEFAULT 0,
message MEDIUMTEXT NOT NULL,
KEY shout_date (shout_date)
)
...results in:
Error Code: 1075 - Incorrect table definition; there can be only one auto column and it must be defined as a key
I added primary key but still get error.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…