Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

The column width of integer types is ignored in your MySQL version unless defining a TINYINT(1) column Documentation

I’m trying to create an INT with primary key and auto AUTO_INCREMENT column in MYSQL and I’m getting this error The column width of integer types is ignored in your MySQL version unless defining a TINYINT(1) column Documentation
What should I do to make it work?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Just remove the "length" part of the integer type. It is deprecated in the current version of MySQL.

WRONG:

CREATE TABLE mytable (
 id INT(11) AUTO_INCREMENT PRIMARY KEY
 ...

RIGHT:

CREATE TABLE mytable (
 id INT AUTO_INCREMENT PRIMARY KEY
 ...

The "length" of an integer always meant almost nothing, even for TINYINT.

See my answer to Types in MySQL: BigInt(20) vs Int(20)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading