|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
"MySQL server has gone away" Error
I having some trouble with this and would appreciate someones help.
I have a script that allows users to upload pictures. The script puts the pictures in a blob in MySQL. The script works fine - I have tested it numerous times with relatively small files. However, when I upload a larger file (above 1MB) I get the "MySQL server has gone away" error. Ive looked up the error in the MySQL documentation and found this: ------ If you need big queries (for example, if you are working with big BLOB columns), you can increase the query limit by starting mysqld with the -O max_allowed_packet=# option (default 1M). ------ Now, I am using MySQL on a server provided by a shared hoster (Interland). I dont know much about the innards of MySQL. Can I still do this? If not, is there some way around this? Thanks a lot for any help. Joe |
|
#2
|
||||
|
||||
|
Is it important that you put the images in the database?
An alternative could be to upload the pictures to a folder and put the file name and path into the database as a VARCHAR |
|
#3
|
||||
|
||||
|
Yeah, I'd store the pictures on the file system with references to them stored in the database as MadCowDzz suggests. You'd have trouble getting Interland to modify their mysql setup for you, and even if you did, any time they had to restart mysql, they'd have to remember to add the max_allowed_packet option, and there's little chance of that being remembered.
|
|
#4
|
|||
|
|||
|
They can alter their /etc/my.cnf file to allow larger size of packets, but I would NEVER use mySQL to store files.
File stored in mySQL database will never work the best, and you can't expect to get better performance. |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > "MySQL server has gone away" Error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|