错误提示为:: 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 '})' at line 1创建的表为
CREATE TABLE `test_data` (  
  `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be unique.',  
  `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or not. A value of 0 means FALSE.',  
  `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',  
  UNIQUE (  
    `order_id`  
  )  
) ENGINE = innodb COMMENT = 'LoadRunner test data';  

解决方案 »

  1.   

    你的MYSQL版本,在5.1.31下测试没有问题
      

  2.   

    我用的5.1.35,除了重装mysql外有没其他办法解决啊
      

  3.   

    你贴出来的这个语句没有任何问题。 建议你也向我这样做测试。
    从你的报错提示上看,'})' 这个符号根本没有出现在你提供的这句上,应该是另外一句有问题。注意那个大括号}mysql> CREATE TABLE `test_data` (
        -> `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be unique.',
        -> `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or not. A value of 0 means FALSE.',
        -> `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',
        -> UNIQUE (
        ->   `order_id`
        -> )
        -> ) ENGINE = innodb COMMENT = 'LoadRunner test data';
    Query OK, 0 rows affected (0.06 sec)mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.33-community-log |
    +----------------------+
    1 row in set (0.00 sec)mysql>
      

  4.   

    你是在MYSQL中运行?是真实代码吗?
      

  5.   

    [Quote=引用 3 楼 ACMAIN_CHM 的回复:]
    你贴出来的这个语句没有任何问题。 建议你也向我这样做测试。 
    从你的报错提示上看,'})' 这个符号根本没有出现在你提供的这句上,应该是另外一句有问题。注意那个大括号} 还是有错误啊:mysql> CREATE TABLE 'test_data'(
        -> `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be uniqu
    e.',
        -> `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or
     not. A value of 0 means FALSE.',
        -> `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',
        -> UNIQUE (
        -> `order_id`
        -> )
        -> ENGINE = innodb COMMENT = 'LoadRunner test data';
    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 ''test
    _data'(
    `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be' at line 1
    mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.35-community-log |
    +----------------------+
    1 row in set (0.00 sec)mysql>
      

  6.   

    你的语句和你楼上一开始贴出来的并不一样!
    少了个括号!UNIQUE (  
      `order_id`  
    )  
    ENGINE = innodb COMMENT = 'LoadRunner test data'; 
      

  7.   

     这个我知道原因了,我是用LR来测这段代码的,在LR里面执行时最后一行少了个右括号,但修改后还是有错。
      

  8.   

    在CMD下执行下面语句的时候就是下面这些信息及错误了。mysql> show table test_data;
    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 'test_
    data' at line 1
    mysql> CREATE TABLE 'test_data'(
        -> `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be uniqu
    e.',
        -> `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or
     not. A value of 0 means FALSE.',
        -> `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',
        -> UNIQUE (
        -> `order_id`
        -> )
        -> ENGINE = innodb COMMENT = 'LoadRunner test data';
    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 ''test
    _data'(
    `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be' at line 1
    mysql> select version();
    +----------------------+
    | version()            |
    +----------------------+
    | 5.1.35-community-log |
    +----------------------+
    1 row in set (0.00 sec)mysql>
      

  9.   

    mysql> CREATE TABLE 'test_data'(
      -> `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be uniqu
    e.',
      -> `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or
     not. A value of 0 means FALSE.',
      -> `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',
      -> UNIQUE (
      -> `order_id`
      -> )
      -> ENGINE = innodb COMMENT = 'LoadRunner test data';已经讲过一遍了,你少了一个括号! ) ENGINE你能直接复制你顶楼的代码去执行吗?
      

  10.   

    6楼已经说过,
    'test_data'->`test_data`
      

  11.   

    就是试了之后不行的嘛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 ')ENGINE = innodb COMMENT = 'LoadRunner test data'; 
    ' ' at line 6 
      

  12.   

    这是在mysql里面建表的过程
    CREATE TABLE `test_data` (  
      `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be unique.',  
      `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or not. A value of 0 means FALSE.',  
      `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',  
      UNIQUE (  
        `order_id`  
      )  
    ) ENGINE = innodb COMMENT = 'LoadRunner test data';
      

  13.   

    to yaoxy,现在你什么都不去动,就直接复制下面这个SQL语句执行,好吗?CREATE TABLE `test_data` (  
    `order_id` BIGINT UNSIGNED NOT NULL COMMENT 'Order numbers. Must be unique.',  
    `status` BOOL NOT NULL DEFAULT '0' COMMENT 'Whether data has been used or not. A value of 0 means FALSE.',  
    `date_used` DATETIME NULL COMMENT 'Date/time that the data was used.',  
    UNIQUE (  
      `order_id`  
    )  
    ) ENGINE = innodb COMMENT = 'LoadRunner test data';