gpt4 book ai didi

php - mysql无法执行user_id

转载 作者:行者123 更新时间:2023-11-29 01:37:53 26 4
gpt4 key购买 nike

这里有一张我制作 MySQL 表的图片,但是当我试图保存它时,出现了一个错误

#1089 - Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys

[ image description 1

在这里您可以在 SQL 编辑器中看到错误的样子,这将是描述底部的代码(SQL 查询代码)

image description

CREATE TABLE `User_System`.`usersystem` (
`user_id` INT(11) NOT NULL AUTO_INCREMENT ,
`username` VARCHAR(25) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`password` VARCHAR(1024) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`first_name` VARCHAR(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`last_name` VARCHAR(40) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL ,
`active` INT(10) NOT NULL DEFAULT '0' ,
PRIMARY KEY (`user_id`(11)))
ENGINE = InnoDB CHARACTER SET latin1 COLLATE latin1_swedish_ci
COMMENT = 'User login and register';

最佳答案

从您的主键定义中删除 (11)。键应该只包含列名,而不是它们的类型或大小

关于php - mysql无法执行user_id,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34685267/

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