#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.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ioannis AnifantakisSoftware 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"

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.