• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Can't add Table.

enriel

Big L
Joined
Dec 14, 2007
Messages
1,254
Reaction score
2
Location
Montenegro
Why do I get this message every-time I try to import player_deaths?

#1005 - Can't create table 'theforgottenserver.player_deaths' (errno: 150)

and I try to import this:

CREATE TABLE `player_deaths`
(
`id` INT NOT NULL AUTO_INCREMENT,
`player_id` INT NOT NULL,
`date` BIGINT UNSIGNED NOT NULL,
`level` INT UNSIGNED NOT NULL,
PRIMARY KEY (`id`), INDEX (`date`),
FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE
) ENGINE = InnoDB
 
MySQL :: MySQL 5.1 Reference Manual :: 13.6.4.4 FOREIGN KEY Constraints

"If you re-create a table that was dropped, it must have a definition that conforms to the foreign key constraints referencing it. It must have the right column names and types, and it must have indexes on the referenced keys, as stated earlier. If these are not satisfied, MySQL returns error number 1005 and refers to error 150 in the error message.

If MySQL reports an error number 1005 from a CREATE TABLE statement, and the error message refers to error 150, table creation failed because a foreign key constraint was not correctly formed. Similarly, if an ALTER TABLE fails and it refers to error 150, that means a foreign key definition would be incorrectly formed for the altered table. You can use SHOW ENGINE INNODB STATUS to display a detailed explanation of the most recent InnoDB foreign key error in the server."
 
Back
Top