Page 1 of 1

mysql connection has gone away

Posted: Sat May 16, 2009 5:21 pm
by jazz090
im trying to upload files into mysql but for files bigger than 1 mb, it throws that error. So i did a little reasearch and they mostly said change max_allowed_packet in mysql to bigger size. i did that and i still get this error. any ideas?

Re: mysql connection has gone away

Posted: Sat May 16, 2009 5:32 pm
by Defiline
im trying to upload files into mysql
It is very, very BAD.
Do NOT do that EVER :)

Re: mysql connection has gone away

Posted: Sat May 16, 2009 6:09 pm
by ldougherty
Generally this is not a good idea as you don't want to store large file(s) in a database.

If you are getting the message, it is not due to a setting or limit. The message means you have lost connection to the mySQL server which could be due to many different reasons but likely just server performance.

Re: mysql connection has gone away

Posted: Sat May 16, 2009 6:12 pm
by Benjamin
Well what's the error? Did you restart MySQL after changing the size? Are the PHP memory limit and, max post size and max upload size settings too low? And the previous post is correct. What you ought to be doing is storing the file name in the database, not the actual file.