#1048 - Column 'Blob' cannot be null

Ive got an SQL statment which keeps failing saying Blob cannot be null, but it isnt!!!

I belive the error is when the file size is too big, and it then just fails.

Is there another command or a way around increasing the maxFile limit of load_file?

The command Im currently using is:-
INSERT INTO `emailaudit_2010_01`.`email` (`priID`, `Blob`)VALUES ('bd9100c8-3da2-11df-9f1e-7aa7d63dacaa', load_file('d:\\msg.msg'))

If I put a smaller file in place of d:\msg.msg the command works great, so I think its definatly to do with size.
tonelm54Asked:
Who is Participating?
 
Ioannis AnifantakisConnect With a Mentor Software EngineerCommented:
Ok, your problem is easy to solve

go to "my.ini" file in your mysql folder

You have to add the following line at the end of the my.ini file

set-variable = max_allowed_packet=1600M

For example I set 1600megabytes max allowed packet, you can make it 10M, or whatever you like.
I don't remember the default size, but its small, so if you want to store large amount of data per transaction thats all you have to change in your my.ini

Don't forget once you change that, you have to restart your mysql instance to "see the change"
0
 
tonelm54Author Commented:
As soon as I saw max_allowed_packet I remembered I came across this issue before!

Thanks for helping a dummy out :-S
0
All Courses

From novice to tech pro — start learning today.