Forum: Ruby on Rails activerecord - mysql blobs...

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1ca59ebae43d3490fbcabbe44c3035a5?d=identicon&s=25 barinek (Guest)
on 2006-03-21 19:53
I'm struggling with activerecord and mysql blobs (uploading files)...

blobs over 400K-ish cause the below exception...

ActiveRecord::StatementInvalid in File#upload

Mysql::Error: Lost connection to MySQL server during query:


I've tried blob, mediumblob, and longblob...

I'm using windows xp for development - and have not installed the mysql
gem...

simlar google postings/solutions have not worked

thoughts/suggestions?
B2ee3ee5087b7aa7202a98da372cae00?d=identicon&s=25 Yaroslav Markin (Guest)
on 2006-03-21 21:09
(Received via mailing list)
Suggestion to use file_column.. Sorry if you can't do this.. I'm pretty
sure any DB expert will say you storing blobs in database must suck.
6332b2bc4f2cfe4d972ab6ba9d5570bf?d=identicon&s=25 Bamat Est (Guest)
on 2006-03-21 21:13
(Received via mailing list)
I'm fighting the exact same issue right now myself - so very
interested in seeing if someone comes back with an answer for it.

I did find some old posts here in the mailing list that suggest that
error has to do with some buggy mysql bindings in windows and pointed
to this page

http://wiki.rubyonrails.org/rails/pages/HowToUseMy...

i installed the dll bu haven't gotten it to work yet. Was also going
to try porting the code over to my linux webserver either tonight /
tommorow to see if the problem does go away once it's off of XP.
6332b2bc4f2cfe4d972ab6ba9d5570bf?d=identicon&s=25 Bamat Est (Guest)
on 2006-03-22 22:22
(Received via mailing list)
Update - looks like I was able to solve my issue by merely increasing
the mysql max_allowed_packet parameter.

hopefully that'll solve yours too

-Eldon
1ca59ebae43d3490fbcabbe44c3035a5?d=identicon&s=25 Michael Barinek (barinek)
on 2006-03-23 16:06
very cool - that worked...

- Barinek
This topic is locked and can not be replied to.