【问题标题】:MySQL error code: 1064 during CREATE TABLE in MySQL Workbench [closed]MySQL错误代码:在MySQL Workbench中创建表期间出现1064 [关闭]
【发布时间】:2021-02-04 17:01:05
【问题描述】:

尝试在 MySQL 工作台中创建表,但我不断收到此错误消息“错误代码:1064。您的 SQL 语法有错误;请查看与您的 MySQL 服务器版本相对应的手册以获取正确的语法以在附近使用')' 在第 7 行"

这是我输入的内容...我做错了什么?

create table members (
id varchar (255) primary key,
pswd varchar(255) not null, 
email varchar(255) not null,
member_since timestamp default now() not null,
payment_due decimal (6, 2) not null default 0,
)
;

【问题讨论】:

  • 看起来不像 mysql 语法。对 mysql 的表创建 ddl 做一点谷歌
  • 结束前的,)
  • @DanielW。谢谢你!!有效

标签: mysql sql mysql-workbench


【解决方案1】:

结尾多了一个逗号。

只需将其删除,一切正常。

create table members (
id varchar (255) primary key,
pswd varchar(255) not null, 
email varchar(255) not null,
member_since timestamp default now() not null,
payment_due decimal (6, 2) not null default 0)

Db<>fiddle

【讨论】:

    猜你喜欢
    • 2011-04-17
    • 2012-07-11
    • 2012-10-22
    • 2021-04-15
    • 2021-03-05
    • 2018-04-14
    • 2018-01-26
    • 2019-05-17
    相关资源
    最近更新 更多