gpt4 book ai didi

MySQL 错误 1604 位于第 1 行 ') NOT NULL, )' 附近

转载 作者:行者123 更新时间:2023-11-30 00:24:42 29 4
gpt4 key购买 nike

mysql> USE bitcoin;
Database changed
mysql> CREATE TABLE btc ( uuid VARCHAR(36) NOT NULL, ign VARCHAR(20) NOT NULL, btc DOUBLE(30) NOT NULL, ) ENGINE=InnoDB;
ERROR 1064 (42000): 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 ') NOT NULL, ) ENGINE=InnoDB' at line 1
mysql> CREATE TABLE btc ( uuid VARCHAR(36) NOT NULL, ign VARCHAR(20) NOT NULL, btc DOUBLE(30) NOT NULL, );
ERROR 1064 (42000): 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 ') NOT NULL, )' at line 1
mysql> CREATE TABLE btc ( uuid VARCHAR(36) NOT NULL, ign VARCHAR(20) NOT NULL, btc DOUBLE(30) NOT NULL, );

在 Debian 上使用 MYSQL 命令行时会引发此错误。我正在尝试创建一个具有给定值的表。

mysql> CREATE TABLE btc ( uuid VARCHAR(36) NOT NULL, ign VARCHAR(20) NOT NULL, btc DOUBLE(30) NOT NULL);
ERROR 1064 (42000): 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 ') NOT NULL)' at line 1
mysql>

也不起作用。

最佳答案

在每个 CREATE TABLE 语句中的最后一个 NOT NULL 和右括号之间有一个额外的 ,,并且在我认为无效的 DOUBLE(30):

mysql> CREATE TABLE btc ( uuid VARCHAR(36) NOT NULL, ign VARCHAR(20) NOT NULL,
btc DOUBLE(30) NOT NULL, ) ENGINE=InnoDB;
^^^^ ^

删除它,因此语句的结尾改为 btc DOUBLE NOT NULL) ENGINE=InnoDB;

关于MySQL 错误 1604 位于第 1 行 ') NOT NULL, )' 附近,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22975258/

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