分享、学习、提高
2007/12/07 13:14
mysql> select * into outfile '/home/hx/071206.txt' from goto_visit where info_date='2007-12-06' order by amount desc limit 0,10;
ERROR 1045: Access denied for user: 'goto@localhost' (Using password: YES)

改用root登陆,操作提示:
ERROR 1: Can't create/write to file '/071206.txt' (Errcode: 13)

按照这篇:http://www.itlearner.com/article/2007/3940.shtml的介绍,是要修改my.cnf。但是在linux上似乎找不到这个文件。

后来,使用select * into outfile '071206.txt' from hx.goto_visit limit 0,10;
成功!071206.txt存放在mysql安装目录的data目录。
如果
use hx;
select * into outfile '071206.txt' from goto_visit limit 0,10;
这样的话071206.txt存放在data/hx目录。

另外,对于第一个提示没有权限的问题,是这个数据库用户没有file权限导致的。
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]