解决方案 »

  1.   

    mysql -u root --password=xxx  --comment < test.sql
      

  2.   

    对, 加上 --comment选项.详见:
    --comments, -i Write additional information in the dump file such as program version, server version, and host. This option is enabled by default. To suppress this additional information, use --skip-comments. 
      

  3.   

    那如果我一定要用 source 导入就没办法了?
      

  4.   

    能用source的地方,想必用mysql也可以替代.
    如果一定要用source,那就没有办法了.在送达server之前, source命令已经将注释去掉了.
      

  5.   

    用行命令带上 --comment 参数吧。