gpt4 book ai didi

mysql - ALTER TABLE table_name AUTO_INCREMENT = 1000;给我语法错误

转载 作者:行者123 更新时间:2023-11-29 04:16:59 25 4
gpt4 key购买 nike

这是我的表导出:

CREATE TABLE IF NOT EXISTS `order` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`comment` varchar(255) COLLATE utf8_unicode_ci NOT NULL,

`shipping_cost` double DEFAULT NULL,

`customer_id` int(11) NOT NULL,

`delivery_type` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,

`invoice_nr` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,

`created_at` timestamp NULL DEFAULT NULL,

`updated_at` timestamp NULL DEFAULT NULL,

`deleted_at` timestamp NULL DEFAULT NULL,

PRIMARY KEY (`id`),

KEY `order_customer_id_index` (`customer_id`),

KEY `order_invoice_nr_index` (`invoice_nr`),

KEY `order_created_at_index` (`created_at`),

KEY `order_updated_at_index` (`updated_at`)

) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;

当我现在运行时:

ALTER TABLE order AUTO_INCREMENT=1000;

我得到:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order AUTO_INCREMENT=1000' at line 1

table 是空的!

mysql版本:5.5.44-0ubuntu0.14.04.1

有人知道是什么导致了我这个问题吗?

如果我举个例子:

ALTER TABLE asdasdfasdfasdf AUTO_INCREMENT=1000;

我明白了

1146 - Table 'mydb.asdasdfasdfasdf' doesn't exist

最佳答案

尝试:

ALTER TABLE `order` AUTO_INCREMENT=1000;

Order 是一个保留字,它试图排序...

关于mysql - ALTER TABLE table_name AUTO_INCREMENT = 1000;给我语法错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39827222/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com