DROP TABLE IF EXISTS sms_access;CREATE TABLE sms_access (
  role_id smallint(6) unsigned NOT NULL,
  node_id smallint(6) unsigned NOT NULL,
  pid smallint(6) unsigned NOT NULL,
  level tinyint(1) NOT NULL,
  module varchar(50) DEFAULT NULL,
  KEY groupId (role_id),
  KEY nodeId (node_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;单独执行删除语句或者创建语句没有问题,但是一直执行就会报错
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 'CREATE TABLE sms_access (role_id smallint(6) unsigned NOT NULL

解决方案 »

  1.   

    aqua data studio,难道这还和管理工具有关系?
      

  2.   

    换到MYSQL自带的行命令工具测试一下。 显然是工具的问题。
      

  3.   

    mysql> use test;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -ADatabase changed
    mysql> DROP TABLE IF EXISTS sms_access;
    Query OK, 0 rows affected, 1 warning (0.00 sec)mysql> 
    mysql> CREATE TABLE sms_access (
        ->   role_id smallint(6) unsigned NOT NULL,
        ->   node_id smallint(6) unsigned NOT NULL,
        ->   pid smallint(6) unsigned NOT NULL,
        ->   level tinyint(1) NOT NULL,
        ->   module varchar(50) DEFAULT NULL,
        ->   KEY groupId (role_id),
        ->   KEY nodeId (node_id)
        -> ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    Query OK, 0 rows affected (0.00 sec)mysql> 
      

  4.   

    DROP TABLE IF EXISTS sms_access;CREATE TABLE sms_access (
      role_id smallint(6) unsigned NOT NULL,
      node_id smallint(6) unsigned NOT NULL,
      pid smallint(6) unsigned NOT NULL,
      level tinyint(1) NOT NULL,
      module varchar(50) DEFAULT NULL,
      KEY groupId (role_id),
      KEY nodeId (node_id)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    在命令行里面执行完全OK啊。
      

  5.   

    在sqlyog工具里面执行也完全OK:2 queries executed, 2 success, 0 errors, 0 warningsQuery: DROP TABLE IF EXISTS sms_access0 row(s) affectedExecution Time : 0.077 sec
    Transfer Time  : 1.274 sec
    Total Time     : 1.351 sec
    --------------------------------------------------Query: CREATE TABLE sms_access ( role_id smallint(6) unsigned NOT NULL, node_id smallint(6) unsigned NOT NULL, pid smallint(6) unsigned...0 row(s) affectedExecution Time : 0.080 sec
    Transfer Time  : 1.228 sec
    Total Time     : 1.309 sec