gpt4 book ai didi

mysql - 在MySQL Workbench中创建表

转载 作者:行者123 更新时间:2023-11-29 15:38:21 25 4
gpt4 key购买 nike

我的问题是我正在尝试使用MySQL Workbench创建一个简单的表,但是当我执行生成的脚本时,它会引发以下错误:

Operation failed: There was an error while applying the SQL script to the database.
Executing:
CREATE TABLE `new_schema`.`new_table` (
`idnew_table` INT NOT NULL AUTO_INCREMENT COMMENT '',
PRIMARY KEY (`idnew_table`) COMMENT '');

ERROR 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 'COMMENT '')' at line 3
SQL Statement:
CREATE TABLE `new_schema`.`new_table` (
`idnew_table` INT NOT NULL AUTO_INCREMENT COMMENT '',
PRIMARY KEY (`idnew_table`) COMMENT '')

ERROR 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 'COMMENT '')' at line 3
SQL Statement:
CREATE TABLE `new_schema`.`new_table` (
`idnew_table` INT NOT NULL AUTO_INCREMENT COMMENT '',
PRIMARY KEY (`idnew_table`) COMMENT '')

最佳答案

您的CREATE TABLE语法错误。如果您实际上并未添加评论,则无需添加评论。

CREATE TABLE `new_schema`.`new_table` (
`idnew_table` INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT ''
)

关于mysql - 在MySQL Workbench中创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57979017/

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