Your issue is caused by your CREATE TABLE
statement.
number
is not a valid MySQL column data type, you should use INTEGER(10) SIGNED
[sic].
CREATE TABLE pics(id INTEGER(10) SIGNED, pics1 BLOB);
However NUMBER
is a valid data type for Oracle Database, which is very much so different from MySQL.
LOAD_FUNCTION
is not a valid MySQL function [sic].
I believe you are wanting LOAD_FILE
, which will retrieve the file's contents for the blob column.
You should also use double backslashes when referencing Windows file paths, to avoid escape sequence characters like \n
.
INSERT INTO pics(id, pics1)
VALUES(1, LOAD_FILE('C:\\Users\\Vandana\\Desktop\\face\\my_image.jpg'));
Please keep in mind that LOAD_FILE
only has access to the files
located on the system and that the user/group running the database service has read permissions for.
See secure_file_priv
for more details.