rubyonrails@axperia.net
2006-Jun-06 07:26 UTC
[Rails] Troubleshooting "Lost connection to MySQL server.."
Hello all, Though I''ve read all I could about the "Lost connection to MySQL server during query: SHOW FIELDS FROM ...", I''m still unable to use RoR. I''m on Linux Mandriva 2006 / MySQL-4.1.12 / ruby-1.8.2 - The userid/password have access to the database and the table (it''s the root user on MySQL) - I''m on a nonstandard socket/port, but I''ve set the socket in config/databases.yml - The table exists, the name is all lowercase and plural ("recipes") - The table has a primary key called ''id'' (int, autoincrement) - I don''t have the "old passwords" in my MySQL setup - The Application Trace, Framework Trace, Full Trace, session dump don''t show anything useful - The MySQL log shows nothing either. Nor syslog. How on earth can I find out exactly what is going on ? Is there some place where RoR dumps exactly what it is trying to do and what error status it receives ? Thanks for any help -- Jean Marc
Alan Francis
2006-Jun-06 12:37 UTC
[Rails] Re: Troubleshooting "Lost connection to MySQL server.."
rubyonrails@axperia.net wrote:> Hello all, > > Though I''ve read all I could about the "Lost connection to MySQL > server during query: SHOW FIELDS FROM ...", I''m still unable to use RoR.I seem to remember I got this until I installed the mysql gem. A. -- Posted via http://www.ruby-forum.com/.
Alan Francis
2006-Jun-06 12:39 UTC
[Rails] Re: Troubleshooting "Lost connection to MySQL server.."
Alan Francis wrote:> rubyonrails@axperia.net wrote: >> Hello all, >> >> Though I''ve read all I could about the "Lost connection to MySQL >> server during query: SHOW FIELDS FROM ...", I''m still unable to use RoR. > > I seem to remember I got this until I installed the mysql gem. > > A.http://wiki.rubyonrails.org/rails/pages/Mysql+Connection+Problems Ignore all the apt-get stuff and scroll until you see the gem :-) A. -- Posted via http://www.ruby-forum.com/.
rubyonrails@axperia.net
2006-Jun-06 13:52 UTC
[Rails] Re: Troubleshooting "Lost connection to MySQL server.." [SOLVED]
>>> Though I''ve read all I could about the "Lost connection to MySQL >>> server during query: SHOW FIELDS FROM ...", I''m still unable to use RoR.Thanks to all (thanks Alan) : - On Mandriva 2006 with MySQL : install the following packages : ruby apache-mod_ruby ruby-RubyGems ruby-mysql Then install the Rails gem with dependencies. gem install --remote rails To check : gem list --local I have those on my machine : actionmailer (1.2.1) actionpack (1.12.1) actionwebservice (1.1.2) activerecord (1.14.2) activesupport (1.3.1) rails (1.1.2) rake (0.7.1) sources (0.0.1) I guess that the mysql gem which does not appear here is in fact set up by the ruby-mysql package, at least on Mandriva. It works, whereas "gem install mysql -- --with-mysql-config=`which mysql_config`" seems to require the Ruby headers and asks what version of ruby-mysql you want. Setup the config/database.yml, not forgetting to set, if necessary, the path to a non-standard socket : development: adapter: mysql database: mydatabase username: myuser password: mypassword host: localhost socket: /path/to/nonstandard.sock Make sure that your MySQL database does not use the "old password" system (see in my.cnf and check with mysql_fix_privilege_tables) Create a table with the proper name (for example "recipes" all lowercase, plural if you follow http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html) Make sure that this table has a primary key called "id" (all lowercase, integer, auto increment, primary) Make sure that your user can access the database and the table Then try ruby script/generate scaffold Recipe If you don''t get any error message, it looks good. Then ruby script/server and browse to http://localhost:3000/recipe Should Work First Time (TM) :-))) -- Jean Marc
subimage interactive
2006-Jun-07 08:57 UTC
[Rails] Re: Troubleshooting "Lost connection to MySQL server.."
I know this question is about Linux - but for the benefit of others searching for this problem... I had this on windows until I installed the newest mysql/ruby bindings available here: http://www.vandomburg.net/pages/mysql-ruby-windows On 6/6/06, Alan Francis <alancfrancis@gmail.com> wrote:> > Alan Francis wrote: > > rubyonrails@axperia.net wrote: > >> Hello all, > >> > >> Though I''ve read all I could about the "Lost connection to MySQL > >> server during query: SHOW FIELDS FROM ...", I''m still unable to use > RoR. > > > > I seem to remember I got this until I installed the mysql gem. > > > > A. > > > http://wiki.rubyonrails.org/rails/pages/Mysql+Connection+Problems > > Ignore all the apt-get stuff and scroll until you see the gem :-) > > A. > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- seth at subimage interactive http://www.subimage.com/sublog/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060606/11a84cb0/attachment-0001.html