【问题标题】:ERROR 1064 (42000) creating table in mysqlERROR 1064 (42000) 在 mysql 中创建表
【发布时间】:2016-02-16 03:03:41
【问题描述】:

我想在数据库中创建一个新表。

mysql> create table 'lps_inventory' (eartag int(11) not null,
    -> bulk tinyint(4),
    -> hpt int(11),
    -> idbox varchar(30),
    -> location char(10),
    -> comnt varchar(40));

我收到了这个错误

ERROR 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以获取正确的语法,以便在 'creat table 'lps_inventory' 附近使用(eartag int(11) not null, 批量 tinyint(4), hpt int(1' 在第 1 行

我该如何解决这个问题?

【问题讨论】:

    标签: mysql


    【解决方案1】:
    quote should be `, not ', or do it without quote.
    

    【讨论】:

    • 这很尴尬。我用create,还是一样的错误。
    • lps_inventory 不应加引号
    • 你不需要引号
    【解决方案2】:

    试试这个:

    create table lps_inventory (eartag int(11) not null,
        bulk tinyint(4),
         hpt int(11),
         idbox varchar(30),
         location char(10),
         comnt varchar(40));
    

    【讨论】:

      猜你喜欢
      • 2022-11-04
      • 1970-01-01
      • 2014-07-05
      • 1970-01-01
      • 1970-01-01
      • 2018-01-26
      • 1970-01-01
      • 2013-12-22
      • 1970-01-01
      相关资源
      最近更新 更多