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

Out of range value for column 'id' at row 1 in MYSQL

When I am trying to insert something to my table I am getting this error on my network tab.
"Out of range value for column ‘id’ at row 1"

In my database table ID column have the following properties.
id –> int(11), not null, auto-increment.

and I am trying to insert the following details to my table

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

          INSERT INTO `my_table` (`type_id`, `email`, `p_name`, `status`, `call`) 
          VALUES (4, 'name@gmail.com', 'Self', '0', '1')

I had also tried passing null to ID while inserting it into the DB table, but it didn’t work.

>Solution :

Likely your auto increment column id has grown large and the next auto increment value (which is generated with the insert statement) has become too large for it.
You can confirm this by checking what is the current auto increment value

select  `AUTO_INCREMENT`
from  INFORMATION_SCHEMA.TABLES
where TABLE_SCHEMA = <your db name> 
and   TABLE_NAME   = `my_table`;

reference : https://dev.mysql.com/doc/mysql-tutorial-excerpt/5.7/en/example-auto-increment.html

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