Jump to content

SQL experts... please come


Yuvasamudram

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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…

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...