Quantcast
Channel: WampServer - WampServer English
Viewing all articles
Browse latest Browse all 3177

How to insert image directly in mysql using command? (1 reply)

$
0
0
Hello sir,
I am trying to inset a small image img.png (57.7KB) into mysql database. Table structure is id(int) and image(blob). I directly inserting image can cause problems but I need this for test purpose. I am using windws 10 os and WampServer 3.1.7 64 bit. (mysql 5.7.24) and My image is located at local disk drive F.

I can insert the image using localhost/phpmyadmin but
when I try command-line using the following command:

insert into image(id,image) values (2,load_file('f:\img.png'));

or

insert into image(id,image) values (2,load_file('f:\\img.png'));


error occurs :-
ERROR 1048 (23000): Column ‘image’ cannot be null



Please help. 

Viewing all articles
Browse latest Browse all 3177

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>