select * into outfile 'T2004.dat' fields optionally enclosed by '"' terminated by ',' from user_info;
用上面的方法正确,我想我一定有创建文件的权限。

解决方案 »

  1.   

    错误信息:ERROR 1064: You have an error in your SQL syntax.  Check the manual that corresp onds to your MySQL server version for the right syntax to use near '@FileName fi elds optionally enclosed by  '"'  terminated by  ',
    mysql> select * into outfile 'mydata.log' fields optionally enclosed by  '"'  terminated by  ','  from user_info;
    ERROR 1046: No Database Selected
      

  2.   

    上面那个帖错了。
    错误信息:ERROR 1064: You have an error in your SQL syntax. Check the manual that corresp onds to your MySQL server version for the right syntax to use near '@FileName fi elds optionally enclosed by '"' terminated by ',
      

  3.   

    ERROR 1046: No Database Selected
    ////////////
    在前面加上:use databasename;
      

  4.   

    回复人:julise(逆风飞扬) ( ) 信誉:100  2004-09-25 12:25:00  得分:0

    ERROR 1046: No Database Selected
    ////////////
    在前面加上:use databasename;--------------------------------------------------------------------
    问题不在那里,是我多帖了。
      

  5.   

    真的像shuixin13(犬犬(心帆))所说的 文件名不可以为变量 吗?