Forum: Ruby on Rails Lost Connection to MySql during query.

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.
Ben Lewis (Guest)
on 2006-04-03 11:19
hi all,

I am getting an error when trying to connect to a mysql server on my
'production' linux server.  The rails app works fine when connecting to
the 'development' mysql on my windows development server.

I have looked at the following wiki:
http://wiki.rubyonrails.com/rails/pages/Mysql+Conn...
and I installed the mysql gem, however this does not seem to have fixed
the problem.

The exact error message is as follows
Mysql::Error: Lost connection to MySQL server during query: SELECT
COUNT(*) FROM Orders

The following is my list of installed gems on the production linux
server.

#gem list
*** LOCAL GEMS ***
actionmailer (1.2.0, 1.1.5)
actionpack (1.12.0, 1.11.2)
actionwebservice (1.1.0, 1.0.0)
activerecord (1.14.0, 1.13.2)
activesupport (1.3.0, 1.2.5)
fcgi (0.8.6.1)
mysql (2.7)
rails (1.1.0, 1.0.0)
rake (0.7.0)
sources (0.0.1)

The production server is running FC4.

I can connect to the production mysql server using the username and
password supplied in the rails app.

Don't know if its relevant, but the webserver is running lighttpd.

Any Ideas?

Thanks,
~Ben
Craig W. (Guest)
on 2006-04-03 11:44
(Received via mailing list)
On Mon, 2006-04-03 at 09:19 +0200, Ben Lewis wrote:
>
> actionpack (1.12.0, 1.11.2)
>
> I can connect to the production mysql server using the username and
> password supplied in the rails app.
>
> Don't know if its relevant, but the webserver is running lighttpd.
>
> Any Ideas?
----
1 - did you install mysql gem on the fedora system?

sudo gem install mysql

2 - did you fix for shift from Windows to Linux?

cd /rails_root
rake rails:update

3 - SELinux issues?

look for errors in /var/log/messages - things about 'avc denied'

4 - it's only relevant about webserver and lighttpd if it's not working.

look for errors in /rails_root/log/production.log
look for errors in /var/log/lighttpd/error_log

Craig
Ben Lewis (Guest)
on 2006-04-04 02:31
> 1 - did you install mysql gem on the fedora system?
>
> sudo gem install mysql
Yes

>
> 2 - did you fix for shift from Windows to Linux?
>
> cd /rails_root
> rake rails:update
I don't know what this achieves, but I get the following errors several
hundred times.
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/inflections.rb:2:
warning: ambiguous first argument; put parentheses or even spaces


> 3 - SELinux issues?
>
> look for errors in /var/log/messages - things about 'avc denied'
SELinux not enabled.  No Errors in this log file.

> 4 - it's only relevant about webserver and lighttpd if it's not working.
Note - I only get this error using the production mysql server. The
development mysql server works fine.
>
> look for errors in /rails_root/log/production.log
No Errors

> look for errors in /var/log/lighttpd/error_log
No Errors
Sathish K. N (Guest)
on 2006-04-04 06:13
(Received via mailing list)
Copying mysql.so into \1.8\i386-mswin32\ solved "Lost connection to
MySQL
server" when connecting to remote server from XP.
http://wiki.rubyonrails.com/rails/pages/HowToUseMy...
This topic is locked and can not be replied to.