Xavjer
Xavjer

Reputation: 9226

Strange behaviour in MySql

I don't get it what the problem is, i have the following query:

Key Definition: id = integer(12)

INSERT INTO `MyTable` (`id`,`name`,`ordering`,`state`,`category`) VALUES ('201310156239','geez','0','1','b') 

Id is my Primary key, when trying to insert this SQL, i get the following error:

#1062 - Duplicate entry '2147483647' for key 'PRIMARY'

The number written here is not the one I want to insert as my primary key, how can this happen? What am I doing wrong...

Upvotes: 1

Views: 35

Answers (1)

Rahul Tripathi
Rahul Tripathi

Reputation: 172398

The range of integer is -2147483648 to 2147483647 in MYSQL and you are violating the range.

Check this for reference. Integer Types

Upvotes: 1

Related Questions