[Solution for uploading files > 16MB with MySQL 4.x installations:] Re: [opencms-dev] max_allowed_packet setting for the client?

arash.kaffamanesh at betasystems.com arash.kaffamanesh at betasystems.com
Thu Jul 28 14:31:55 CEST 2005


Hi Claus,

thank you very much for the hint, which guided me to the following solution
by changing the MEDIUMBLOB datatype of FILE_CONTENT to "LONGBLOB"
(the documentation on dev.mysql site is a bullshit regarding this issue).

Solution for uploading files > 16MB to OpenCms with MySQL 4.x
installations:

Shell> mysql -uroot -p
Shell> use opencms;
Shell> ALTER TABLE CMS_OFFLINE_CONTENTS MODIFY COLUMN FILE_CONTENT LONGBLOB
NOT NULL;
Shell> ALTER TABLE CMS_ONLINE_CONTENTS MODIFY COLUMN FILE_CONTENT LONGBLOB
NOT NULL;

and set max_allowed_packet > 16M, e.g  max_allowed_packet=64M in my.cnf

Please Note: don't make these changes on a production system, as I don't
know if it would have any undesirable sideeffects.

(perhaps this issue could become a post on opencms-forum.de)

Thanks again.

Best Regards,
Arash Kaffamanesh


opencms-dev-bounces at opencms.org wrote on 27.07.2005 17:06:35:

> File contents are stored in a mediumblob field when using MySQL, meaning
> 2^24 bytes aka 16MB, so if you have one single file that exeeds this
> size then it sounds like somewhere the data silently gets pruned to the
> max size.
>
> ark-d at betasystems.com wrote:
> > Hi all,
> >
> > I have the following problem as many of you had before by uploading
files >
> > 16MB.
> > if I set the "max_allowed_packet=64M" in my.cnf (my.ini on windows) for
> > mysqld, I still can't upload files > 16M.
> >
> > On dev.mysql website I can read the following:
> >
> > "Both the client and the server have their own max_allowed_packet
variable,
> > so if you want to handle big packets, you must increase this variable
both
> > in the client and in the server.!
> >
> > source :  http://dev.mysql.com/doc/mysql/en/packet-too-large.html
> >
> > so now my question:
> >
> > does OpenCms / Tomcat act as a client for mysql (obviously yes)?
> > if yes, how can I set the "max_allowed_packet=64M" variable for the
client
> > to be able to upload files > 16MB to the database?
> >
> > I have tried to set CATALINA_OPTS, JAVA_OPTS, export
max_allowed_packet=64M
> > and some other settings over the shell on linux and windows,
> > but none of them help and I could read in OpenCms source that the file
size
> > to upload depends on the available memory on the server and I know,
there
> > is no setting in opencms-*.xml or opencms.properties file for that.
> >
> > I also have increased the heap size for tomcat with -Xms=512M
-Xmx=1024M.
> >
> > What happens:
> >
> > The upload process goes to the end and the file will be shown in the
> > workplace with the right size, but if I download it (a zip file) it has
> > exactly 16MB.
> >
> > I'm using:
> >
> > OpenCms 6.0.0 and 6 Beta3
> > Java 1.4.2 and Java 1.5
> > MySQL 4.0.21 and MySQL 4.1.13
> >
> > Does this problem exist with Oracle 9i too?
> > Has anybody tried to upload files > 16M to a Oracle 9 database?
> >
> > Thanks for possible hints.
> >
> > Best Regards,
> > Arash
> >
> >
> >
> > _______________________________________________
> > This mail is send to you from the opencms-dev mailing list
> > To change your list options, or to unsubscribe from the list, please
visit
> > http://mail.opencms.org/mailman/listinfo/opencms-dev
> >
>
> --
> Claus Priisholm, CodeDroids ApS
> cpr (you know what) codedroids.com - http://www.codedroids.com
>
> Javadocs and other OpenCms stuff:
> http://www.codedroids.com/community/opencms
>
>
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
visit
> http://mail.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list