I'm trying to read the content of /etc/passwd from mysql using the following query: select load_file("/etc/passwd"); However, I always seem to get NULL as the output.

mysql> select load_file("/etc/passwd");
| load_file("/etc/passwd") |
| NULL                     |
1 row in set (0.00 sec)

Is there a reason for this? the permission for the passwd file is the default permission.


1 Answer 1


If the SELECT works for you, then it will work for a hacker.

Think twice about breaking through this security barrier.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.