相关文章推荐
憨厚的鼠标垫  ·  ElasticSearch ...·  1 年前    · 
儒雅的冲锋衣  ·  Ubuntu Server snap 安装 ...·  1 年前    · 
深情的手术刀  ·  AWS CLI 用法_aws_Alan ...·  1 年前    · 
英勇无比的麦片  ·  Troubles compilling ...·  2 年前    · 
旅行中的蛋挞  ·  c# - How to force ...·  2 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

load_file returns NULL in Mariadb without error. Where is the reason for this failure logged?

Ask Question 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?

Please include the LOAD statement, SHOW CREATE TABLE , and some indication of what was in the file that led to the NULL . Also SHOW VARIABLES LIKE 'sql_mode'; Rick James Aug 28, 2017 at 18:30

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.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question . Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers .