MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old December 28th, 2003, 12:50 AM
JoePopovich JoePopovich is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 11 JoePopovich User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
"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

Reply With Quote
  #2  
Old December 28th, 2003, 11:30 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 4 m 48 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old December 29th, 2003, 07:13 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
  #4  
Old December 29th, 2003, 04:19 PM
Mike_r Mike_r is offline
ExoCrew
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 68 Mike_r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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.
__________________
ExoHelpDesk
ExoCrew Free Services

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > "MySQL server has gone away" Error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway