本来数据库中有个表叫calls, 想把它改成call, 结构愣是没有成功,后来才想到call是关键字, 不能作为表名使用. 一群人忙活了半天, 想来真是好笑.

解决方案 »

  1.   

    最好不要用关键字做表名,如果要用,加``
    create table `call`(....)
      

  2.   

    这么试了一下,竟报错了:
    mysql> create table 'call' (con1 int);
    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 ''call' (con1 int)' at line 1不过用带数据库名的方法倒是可以:
    mysql> create table dbx.call (con1 int);
    Query OK, 0 rows affected (0.00 sec)
      

  3.   

    create table `call`
    ESC键正面、数字1的左边
      

  4.   

    原来是这个引号,可以了.
    mysql> create table `call` (con1 int);
    Query OK, 0 rows affected (0.00 sec)