今天测试东西,由于系统是生成任务的key作为标识,结果就到一个任务一直报错,就是过不去,生成的mysql表名为37e77d189af09d5d480ca0e3e2058ce7 感兴趣的同学可以试试,结果各种insert select报错~  提示1064,我欲哭无泪呀,惯性的查了各种语法,各种过程,最后实在没办法了,手动修改下标识,结果过了~  这个表名是关键字?天哪。。朋友们在使用mysql的时候,建议表名都加上`表名`,`列名` ,不要像我一样,图一时的简单,结果遇到这个么个问题注意:`不是单引号,是半角输入状态下的 ~ 这个键(1前面的,esc下面的),共勉

解决方案 »

  1.   

    关键字是· 吧 例如:
    mysql> SELECT * FROM `A` LIMIT 1;
    +-------+
    | id    |
    +-------+
    | 1-0-1 |
    +-------+
    1 row in set (0.00 sec)mysql> insert into `A` select '1-1-15';
    Query OK, 1 row affected (0.00 sec)
    Records: 1  Duplicates: 0  Warnings: 0mysql> insert into A select '2-1-13';
    Query OK, 1 row affected (0.00 sec)
    Records: 1  Duplicates: 0  Warnings: 0mysql>
      

  2.   

    情景再现,嘿嘿,楼主是想说的··符号吧。如下所示:mysql> create table 37e77d189af09d5d480ca0e3e2058ce7 (name varchar(20));
    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 '37e77d189af09d5d480ca0e3e2058ce7 (name varchar(20))' at line 1
    mysql> create table `37e77d189af09d5d480ca0e3e2058ce7` (name varchar(20));
    Query OK, 0 rows affected (0.02 sec)mysql> insert into 37e77d189af09d5d480ca0e3e2058ce7 select 'a';
    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 '37e77d189af09d5d480ca0e3e2058ce7 select 'a'' at line 1
    mysql> insert into `37e77d189af09d5d480ca0e3e2058ce7` select 'a';
    Query OK, 1 row affected (0.01 sec)
    Records: 1  Duplicates: 0  Warnings: 0mysql> select * from 37e77d189af09d5d480ca0e3e2058ce7;
    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 '37e77d189af09d5d480ca0e3e2058ce7' at line 1
    mysql> select * from `37e77d189af09d5d480ca0e3e2058ce7`;
    +------+
    | name |
    +------+
    | a    |
    +------+
    1 row in set (0.01 sec)mysql> 
      

  3.   

    to: mchdba 
    赞一个,我是没顾得上写出来,谢谢了~ 就是这个意思的,哈哈。让我昨儿个郁闷了好久的。
      

  4.   

    生成的mysql表名.
    请楼主以 字母开头。
    就可以不用加 ` 标识符了。 create table A37e77d189af09d5d480ca0e3e2058ce7 (name varchar(20));