Getting error while inserting blob datatype value into mysql table

后端 未结 1 474
执念已碎
执念已碎 2021-01-28 04:09

I am trying to enter data into mysql table Fruitbox .But while entering data I am getting error Fruitpdf cannot be null. I created fruitbox table as follows:

相关标签:
1条回答
  • 2021-01-28 04:48

    MySQL treats a backslash in a string as an escape character. You need to use a double backslash :

    LOAD_FILE('C:\\Users\\Tom\\Desktop\\mango.pdf')

    See https://dev.mysql.com/doc/refman/8.0/en/string-literals.html

    Edit : If it still doesn't work :

    • Is the file on the MySQL server ?
    • Is the 'secure_file_priv' variable set ? (SHOW VARIABLES LIKE 'secure_file_priv';) If so, you will need to place the file under that directory.
    • Does your user have the FILE privilege ?
    0 讨论(0)
提交回复
热议问题