我测试mysql的load_file()函数
/test文件的内容是: hello
在debian和rhel下面:
mysql> select load_file("/test");
+--------------------+
| load_file("/test") |
+--------------------+
| hello |
+--------------------+
1 row in set (0.06 sec)
成功
在ubuntu下面:
mysql> select load_file("/test");
+--------------------+
| load_file("/test") |
+--------------------+
| NULL |
+--------------------+
1 row in set (0.06 sec)
失败
请问为什么呀? 我想在ubuntu下面使用load_file(),请大家帮帮我
求助: 测试mysql 的load_file()函数,请大家帮帮我---已结案
- centerpoint
- 帖子: 95
- 注册时间: 2009-11-30 19:38
求助: 测试mysql 的load_file()函数,请大家帮帮我---已结案
上次由 centerpoint 在 2011-07-02 16:31,总共编辑 1 次。
- centerpoint
- 帖子: 95
- 注册时间: 2009-11-30 19:38
Re: 求助: 测试mysql 的load_file()函数,请大家帮帮我
终于在国外论坛找到了原因:
21 Oct 2008 15:07] Chuan Xu
I finally figure out that this issue is caused by apparmor, which is a security service
like selinux on ubuntu. You can either stop it or change the configuration file
/etc/apparmor.d/usr.sbin.mysqld.
[17 Feb 2010 11:15] Tomasz Zdybal
I have same problem with LOAD_FILE on Archlinux / MySQL 5.1.42.
So i think it's not apparmor problem.
[11 May 2010 18:33] Dashamir Hoxha
For those that have problems with LOAD_FILE on Ubuntu, apparmor can definitely a problem
(besides other problems). I had the same problem, stopped apparmor (/etc/init.d/apparmor
stop), and everything worked OK.
21 Oct 2008 15:07] Chuan Xu
I finally figure out that this issue is caused by apparmor, which is a security service
like selinux on ubuntu. You can either stop it or change the configuration file
/etc/apparmor.d/usr.sbin.mysqld.
[17 Feb 2010 11:15] Tomasz Zdybal
I have same problem with LOAD_FILE on Archlinux / MySQL 5.1.42.
So i think it's not apparmor problem.
[11 May 2010 18:33] Dashamir Hoxha
For those that have problems with LOAD_FILE on Ubuntu, apparmor can definitely a problem
(besides other problems). I had the same problem, stopped apparmor (/etc/init.d/apparmor
stop), and everything worked OK.