Jump to content

SQL experts... please come


Recommended Posts

Posted

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.

Posted

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
Posted
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.

Posted

can you try…

select load_file(‘ ‘)…?

 

is it showing null.. there too..?

Posted
1 minute ago, seeva said:

Did you check permissions where your program has read access to this location ?

idi ela check cheyyali?

Posted
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.

Posted
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.

Posted
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…

Posted
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.

Posted
53 minutes ago, Yuvasamudram said:

Emayi poyaru vayya SQL vallu antha?

using NoSQL 

Posted

not much familiar with mysql... but c:/ ilantivi linux lo work avuthaya? shudnt it be something like /var/www/html/images/blahblah.jpg?

Posted
3 minutes ago, pandugadu999 said:

using NoSQL 

Ponile baa nuvvaina joke vesav... Eeee MYSQL try chesi chesi IT ante inka chiraakochindi.

 

Posted
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)

 

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...