Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to store more than 10 mb video into MySql Database?

I need to insert more than 10 MB size video into MySQL database. how to do that?
I try following query.

{  
  insert into mscit_video values(1,'bcg',LOAD_FILE('c:\\abc\\xyz.mpg') 
}  

using this query i stored 1 MB video into database successfully, but if i tried
to insert more than 10MB size of video it give following error.

"java.sql.SQLException: Result of load_file() was larger than max_allowed_packet (1048576) - truncated"  

Is posible to store video in database more than 10 MB? if yes then how?
Give me any rference or hint.
Thanks in Advance..

like image 987
Dnyani Avatar asked Feb 20 '23 14:02

Dnyani


2 Answers

Notice that the problem here is not the database/table/field's capacity, but the packet sending (I've met this problem before while sending very long concatenated queries, from client to server). Do you have administrator rights on your MySQL database? You might want to increase the max allowed packet size.

like image 107
Nadir Sampaoli Avatar answered Feb 23 '23 04:02

Nadir Sampaoli


You need to specify longblob as data type of your movie column. It can store up to 4 GB

like image 21
juergen d Avatar answered Feb 23 '23 05:02

juergen d