MySQL选择进入outfile/tmp无输出 [英] MySQL select into outfile /tmp no output

查看:95
本文介绍了MySQL选择进入outfile/tmp无输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法获得以下代码来生成任何输出. MySQL用户具有所有"授予级别,/tmp是可写的,查询返回结果集.

I cannot get the following code to generate any output. The MySQL user has "all" grant level, /tmp is writable, the query returns a results set.

mysql> SELECT field FROM test_table WHERE condition='test'
    -> INTO OUTFILE '/tmp/test.csv'
    -> FIELDS TERMINATED BY ','
    -> ENCLOSED BY '"'
    -> LINES TERMINATED BY '\n';
Query OK, 1 row affected (0.00 sec)

mysql>
[1]+  Stopped                 mysql
[root@web1 ~]# cat /tmp/test.csv
cat: /tmp/test.csv: No such file or directory

如果出现故障,我应该从MySQL看到不同的输出吗?

Should I be seeing different output from MySQL in case of failure?

我可以验证结果的范围是否超出受影响的1行"吗?

Can I verify the result further than "1 row affected"?

推荐答案

由outfile子句生成的文件在mysql服务器主机上创建.请确保您正在查找mysql服务器主机,因为您似乎在客户端主机上,而该主机很可能不是mysql服务器主机.

The files generate by the outfile clause are created on the mysql server host. Please make sure you are looking on the mysql server host as it seems you are on the client host which most likely isn't the mysql server host.

请参见 http://dev.mysql.com/doc/refman /outside/5.0/zh-CN/select.html 中有关此文件的文档.

See http://dev.mysql.com/doc/refman/5.0/en/select.html in the section about outfile for documentation regarding this.

这篇关于MySQL选择进入outfile/tmp无输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆