Yuvasamudram Posted December 13, 2023 Report Posted December 13, 2023 I am using MYSQL 8.2. Database lo image store cheya lekapothunna why? Cannot store Null ani error vasthundi. Here is my query: INSERT INTO tablename(id,img) VALUES(1,LOAD_FILE('C:/Images/jack.jpg')); My Columns: id int AI PK img longblob My Columns: Cannot store NULL ani vasthundi. Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 Emayi poyaru vayya SQL vallu antha? Quote
seeva Posted December 13, 2023 Report Posted December 13, 2023 Where are you running this on ? On the server where you have the DB, check to see if you have the file at specified location: C:/Images/jack.jpg Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 2 minutes ago, seeva said: Where are you running this on ? On the server where you have the DB, check to see if you have the file at specified location: C:/Images/jack.jpg Naa personal computer lone install chesa MYSQL. File path kuda copy chesa to make sure there are no typos. Just '\' ni '/' tho replace chesa as per somebodies suggestion. Same thing other folks ki work ayindi technical forums lo... Not sure naaku picture kakunda NULL enduku store avuthundo. Quote
dasari4kntr Posted December 13, 2023 Report Posted December 13, 2023 can you try… select load_file(‘ ‘)…? is it showing null.. there too..? Quote
seeva Posted December 13, 2023 Report Posted December 13, 2023 Did you check permissions where your program has read access to this location ? Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 1 minute ago, seeva said: Did you check permissions where your program has read access to this location ? idi ela check cheyyali? Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 7 minutes ago, dasari4kntr said: can you try… select load_file(‘ ‘)…? is it showing null.. there too..? lower case pettina kuda NULL chupisthundi. @seeva cheppinattu edo file permissions, something problem anipisthundi. Quote
seeva Posted December 13, 2023 Report Posted December 13, 2023 5 minutes ago, Yuvasamudram said: idi ela check cheyyali? Since its returning NULL and you're sure the file is not corrupt or empty, my hunch is that the process doesn't have read permission hence it returned NULL. You will have to look up in the manual/docs of MySQL and Windows setup guide about this permissions thing. Another option is check to see the where the data directory of MySQL is and copy the file there and load the file from the data directory. From Internet: If the secure_file_priv system variable is set, it limits the directories from which you can read files using the LOAD_FILE() function. Ensure the file is located in a directory allowed by this variable. Quote
dasari4kntr Posted December 13, 2023 Report Posted December 13, 2023 10 minutes ago, Yuvasamudram said: lower case pettina kuda NULL chupisthundi. @seeva cheppinattu edo file permissions, something problem anipisthundi. select load_file(‘’) with any other file in different directory… or put a temp file mysql bin and try to read it…if that works it could be permissions issue… Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 4 minutes ago, dasari4kntr said: select load_file(‘’) with any other file in different directory… or put a temp file mysql bin and try to read it…if that works it could be permissions issue… MYSQL folder lo README file unte load cheyyataniki try chesa. Same NULL Fault. Quote
pandugadu999 Posted December 13, 2023 Report Posted December 13, 2023 53 minutes ago, Yuvasamudram said: Emayi poyaru vayya SQL vallu antha? using NoSQL Quote
FReddy Posted December 13, 2023 Report Posted December 13, 2023 not much familiar with mysql... but c:/ ilantivi linux lo work avuthaya? shudnt it be something like /var/www/html/images/blahblah.jpg? Quote
Yuvasamudram Posted December 13, 2023 Author Report Posted December 13, 2023 3 minutes ago, pandugadu999 said: using NoSQL Ponile baa nuvvaina joke vesav... Eeee MYSQL try chesi chesi IT ante inka chiraakochindi. Quote
dasari4kntr Posted December 13, 2023 Report Posted December 13, 2023 40 minutes ago, Yuvasamudram said: MYSQL folder lo README file unte load cheyyataniki try chesa. Same NULL Fault. googled it…give it a try… sudo chown mysql:mysql /(your file path) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.