在下面的这个命令中,insert into语句必须一条一条复制、粘贴、执行,如果就把下面的语句作为一个整体粘贴,然后回车,只有“马乐”这个句之前能执行,其后不能执行,请问这是为什么?
CREATE TABLE tb(lqyxsm VARCHAR(10),lqzydm VARCHAR(10),xm VARCHAR(10) CHARACTER SET utf8 ,zf INT);
insert into tb values('014','050403','项峰',359);   
insert into tb values('014','050403','厉文婷',358); 
insert into tb values('014','050403','苏磊',355 ); 
insert into tb values('014','050403','晁洪娜',343 ); 
insert into tb values('014','050403','霍晓娜',338); 
insert into tb values('014','050403','马乐',334 ); 
insert into tb values('014','050403','冯猛',331 ); 
insert into tb values('014','050403','梁容',330 ); 
insert into tb values('014','050403','金碧成',329 ); 
insert into tb values('014','050403','张继迎',328 ); 
insert into tb values('014','050403','聂亚荔',325 ); 
insert into tb values('014','050403','王怡',322  ); 
insert into tb values('014','050403','阮建勇',322 ); 
insert into tb values('015','040102','王大为',314 ); 
insert into tb values('015','040102','何凌云',310 ); 
insert into tb values('016','040102','闫斌',314 ); 
insert into tb values('016','040102','陈德钦',296 ); 
insert into tb values('017','040102','向琴',343 ); 
insert into tb values('017','040102','张世萍',313 ); 
insert into tb values('017','040102','徐浩',311 ); 
insert into tb values('017','040102','侯亚琪',298 ); 

解决方案 »

  1.   

    mysql> set names gbk;
    Query OK, 0 rows affected (0.00 sec)mysql> CREATE TABLE tb(lqyxsm VARCHAR(10),lqzydm VARCHAR(10),xm VARCHAR(10) CHARACTER SET utf8 ,zf INT);
    Query OK, 0 rows affected (0.05 sec)mysql> insert into tb values('014','050403','项峰',359);   
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','厉文婷',358);  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','苏磊',355 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','晁洪娜',343 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','霍晓娜',338);  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','马乐',334 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','冯猛',331 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','梁容',330 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','金碧成',329 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','张继迎',328 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','聂亚荔',325 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','王怡',322 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('014','050403','阮建勇',322 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('015','040102','王大为',314 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('015','040102','何凌云',310 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('016','040102','闫斌',314 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('016','040102','陈德钦',296 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('017','040102','向琴',343 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('017','040102','张世萍',313 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('017','040102','徐浩',311 );  
    Query OK, 1 row affected (0.00 sec)mysql> insert into tb values('017','040102','侯亚琪',298 );
    Query OK, 1 row affected (0.00 sec)mysql> 
    mysql> select * from tb;
    +--------+--------+--------+------+
    | lqyxsm | lqzydm | xm     | zf   |
    +--------+--------+--------+------+
    | 014    | 050403 | 项峰       |  359 |
    | 014    | 050403 | 厉文婷       |  358 |
    | 014    | 050403 | 苏磊       |  355 |
    | 014    | 050403 | 晁洪娜      |  343 |
    | 014    | 050403 | 霍晓娜       |  338 |
    | 014    | 050403 | 马乐       |  334 |
    | 014    | 050403 | 冯猛       |  331 |
    | 014    | 050403 | 梁容       |  330 |
    | 014    | 050403 | 金碧成      |  329 |
    | 014    | 050403 | 张继迎     |  328 |
    | 014    | 050403 | 聂亚荔       |  325 |
    | 014    | 050403 | 王怡       |  322 |
    | 014    | 050403 | 阮建勇      |  322 |
    | 015    | 040102 | 王大为      |  314 |
    | 015    | 040102 | 何凌云       |  310 |
    | 016    | 040102 | 闫斌      |  314 |
    | 016    | 040102 | 陈德钦      |  296 |
    | 017    | 040102 | 向琴       |  343 |
    | 017    | 040102 | 张世萍      |  313 |
    | 017    | 040102 | 徐浩       |  311 |
    | 017    | 040102 | 侯亚琪       |  298 |
    +--------+--------+--------+------+
    21 rows in set (0.00 sec)mysql> 
      

  2.   

    奇怪了,在我的电脑怎么就不行了。我用的是mysql5.5,操作系统是windowsxp的。显示如下情况。
    1064 - 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 ''閲戠ⅶ鎴?,329 )' at line 1
    1064 - 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 ''?户杩?,328 )' at line 1
    1064 - 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 ''鑱備簹鑽?,325 )' at line 1
    1064 - 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 ''鐜??,322  )' at line 1
    1064 - 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 ''闃缓鍕?,322 )' at line 1
    1064 - 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 ''鐜?ぇ涓?,314 )' at line 1
    1064 - 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 ''浣曞噷浜?,310 )' at line 1
    Query OK, 1 row affected1064 - 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 ''闄堝痉閽?,296 )' at line 1
    Query OK, 1 row affected1064 - 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 ''?笘钀?,313 )' at line 1
    Query OK, 1 row affected1064 - 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 ''渚簹鐞?,298 )' at line 1
      

  3.   

    mysql> set names gbk;
    Query OK, 0 rows affected (0.00 sec)
      

  4.   

    检查你的字符集设置问题。
    http://blog.csdn.net/ACMAIN_CHM/archive/2009/05/12/4174186.aspx
    MySQL 中文显示乱码
      

  5.   

    估计你server端的字符集用的不是 UTF8,也不是gbk,
    执行一下show variables like 'char%'
    看看什么结果?