列的超出范围值' id'在MySQL的第1行

发布于 2025-01-22 04:33:22 字数 445 浏览 4 评论 0原文

当我试图将某些内容插入桌子时,我会在网络选项卡上遇到此错误。 我的数据库表ID列中的“第1行”列'ID'的范围值

具有以下属性。 id-> int(11),而不是零,自动灌溉。

我正在尝试将以下细节插入我的桌子上,

          INSERT INTO `my_table` (`type_id`, `email`, `p_name`, `status`, `call`) 
          VALUES (4, '[email protected]', 'Self', '0', '1')

我也尝试将null插入DB表格,但它不起作用。

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

          INSERT INTO `my_table` (`type_id`, `email`, `p_name`, `status`, `call`) 
          VALUES (4, '[email protected]', 'Self', '0', '1')

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娇纵 2025-01-29 04:33:22

您的自动增量列ID可能已增长,并且下一个自动增量值(由插入语句生成)变得太大了。
您可以通过检查当前的自动增量值

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文