title: Can't get load_file() working in mysql
body: <p>I've been struggling for 2 nights now to get load_file() to work, but the results are NULL.
  I run version "5.6.19-0ubuntu0.14.04.1".</p>
  
  <p>Example:</p>
  
  <pre><code>mysql&gt; show variables like '%secure%';
  +------------------+-------------+
  | Variable_name    | Value       |
  +------------------+-------------+
  | secure_auth      | ON          |
  | secure_file_priv | /root/load/ |
  +------------------+-------------+
  mysql&gt; show variables like 'max_allowed%';
  +--------------------+----------+
  | Variable_name      | Value    |
  +--------------------+----------+
  | max_allowed_packet | 16777216 |
  +--------------------+----------+
  
  mysql&gt; desc xmlDocs;
  +-------------+-------------+------+-----+---------+-------+
  | Field       | Type        | Null | Key | Default | Extra |
  +-------------+-------------+------+-----+---------+-------+
  | fileName    | varchar(30) | NO   | PRI | NULL    |       |
  | server      | varchar(20) | NO   |     | NULL    |       |
  | doc_content | blob        | NO   |     | NULL    |       |
  +-------------+-------------+------+-----+---------+-------+
  
  mysql&gt; insert into xmlDocs values ('test','test',load_file('/root/load/test.xml'));
  ERROR 1048 (23000): Column 'doc_content' cannot be null
  </code></pre>
  
  <p>File permissions:</p>
  
  <pre><code>drwxrwxr-x 5 mysql mysql  4096 Nov 24 08:18 .
  drwx------ 6 root  root   4096 Nov 24 08:33 ..
  drwxr--r-- 5 root  root   4096 Nov 22 16:24 EU1
  drwxr--r-- 5 root  root   4096 Nov 22 16:26 server
  -rwxrwxrwx 1 mysql mysql 83440 Nov 24 08:18 test.xml
  drwxr--r-- 5 root  root   4096 Nov 22 16:24 US1
  </code></pre>
  
  <p>Checked:</p>
  
  <ul>
  <li>MySql has execute and even owns the dir</li>
  <li>Mysql ows the file</li>
  <li>DB user = root</li>
  <li>Filesize &lt; max_allowed_packets</li>
  <li>secure-file-priv is set</li>
  <li>I have no apparmor running</li>
  </ul>
  
  <p>Without setting secure-file-priv it can read non important data like /etc/passwd effortlessly :P. Also from "/" i can import, but nowhere else.
  When setting secure-file-priv, I can get it to work from "/" only!</p>
  
  <p>Same file, no secure-file-priv set:</p>
  
  <pre><code>mysql&gt; insert into xmlDocs values ('test','test',load_file("/root/load/test.xml"));
  ERROR 1048 (23000): Column 'doc_content' cannot be null
  mysql&gt; insert into xmlDocs values ('test','test',load_file("/etc/test.xml"));
  Query OK, 1 row affected (0.00 sec)
  </code></pre>
  
  <p>Any ideas?</p>