title: MySQL LOAD_FILE function return 0x -- why? (macOS)
body: <p>I lost a considerable amount of time on this one.</p>
  <p>I'm attempting to load some .lob file to a column in my database but can't make it work. I've tried to isolate the problem but can't find it. Granted, I'm not the expert on MySQL and hope you guys can help me.</p>
  <p>Here's my dump file config (/usr/local/etc/my.cnf )</p>
  <pre><code># Default Homebrew MySQL server config
  [mysqld]
  # Only allow connections from localhost
  bind-address = 127.0.0.1
  mysqlx-bind-address = 127.0.0.1
  innodb_file_per_table
  max_allowed_packet=32M
  secure_file_priv = ''
  </code></pre>
  <p>I set &quot;secure_file_priv&quot; to an empty quote since it was always returning NULL before. The I granted client/server permission:</p>
  <pre><code>SET GLOBAL local_infile=1
  </code></pre>
  <p>Then restart the MySQL service and tried to upload a single file with this command/result:</p>
  <pre><code>mysql&gt; SELECT LOAD_FILE('~/Desktop/mysqltest.txt') AS Result;
  +----------------+
  | Result         |
  +----------------+
  | 0x             |
  +----------------+
  1 row in set (0.00 sec)
  </code></pre>
  <p>I think the result is not normal? Why it returns &quot;0x&quot; instead of the text inside the file?</p>
  <p>I also tried with my complete SQL script:</p>
  <pre><code>Truncate Table capublic.law_section_tbl;
  LOAD DATA LOCAL
    INFILE &quot;LAW_SECTION_TBL.dat&quot;
    INTO TABLE capublic.law_section_tbl
    FIELDS TERMINATED BY '\t'
    OPTIONALLY ENCLOSED BY '`'
    LINES TERMINATED BY '\n'
  (
     ID
    ,LAW_CODE
    ,SECTION_NUM
    ,OP_STATUES
    ,OP_CHAPTER
    ,OP_SECTION
    ,EFFECTIVE_DATE
    ,LAW_SECTION_VERSION_ID
    ,DIVISION
    ,TITLE
    ,PART
    ,CHAPTER
    ,ARTICLE
    ,HISTORY
    ,@var1
    ,ACTIVE_FLG
    ,TRANS_UID
    ,TRANS_UPDATE
  )
  SET CONTENT_XML=LOAD_FILE(concat('/Users/dominicbouchard/Desktop/pubinfo_1/pubinfo/'),@var1)
  </code></pre>
  <p>without success. The terminal gives me this result:</p>
  <pre><code>Username@MacBook-Pro pubinfo % ./loadData.sh
  Please enter root password: ******
  Processing table: bill_version_tbl
  Processing table: codes_tbl
  Processing table: committee_hearing_tbl
  Processing table: daily_file_tbl
  Processing table: law_section_tbl
  Processing table: law_toc_sections_tbl
  Processing table: law_toc_tbl
  Processing table: legislator_tbl
  Processing table: location_code_tbl
  Processing table: veto_message_tbl
  Processing table: committee_agenda_tbl
  </code></pre>
  <p>But no files are actually uploaded and it still shows NULL in my 'content_xml' column Any clue whats going on??  Thanks!</p>
  <p>(post edited)</p>