2

System information:
Linux Fedora 26
Mariadb version 10.1.25

I have executed all the statements as described in MariaDB Insert BLOB Image. In addition I have also disabled selinux.

But load_file still returns NULL without giving an error. I followed these instructions (https://mariadb.com/kb/en/the-mariadb-library/general-query-log/) to enable general logging but 'queries.log' only reports that the query has been executed without giving information on why it returns NULL instead of the wanted output.

Does Mariadb log the reason for this failure? If so, where?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Ben Engbers
  • 433
  • 3
  • 12

2 Answers2

0

Verify the rest of the constraints:

LOAD_FILE(file_name)

Reads the file and returns the file contents as a string. To use this function, the file must be located on the server host, you must specify the full path name to the file, and you must have the FILE privilege. The file must be readable by all and its size less than max_allowed_packet bytes. If the secure_file_priv system variable is set to a nonempty directory name, the file to be loaded must be located in that directory.

If the file does not exist or cannot be read because one of the preceding conditions is not satisfied, the function returns NULL.

The character_set_filesystem system variable controls interpretation of file names that are given as literal strings.

Community
  • 1
  • 1
Rick James
  • 135,179
  • 13
  • 127
  • 222
-1

You need ALL directories in the path have SET executable bit