Running rails 1.1 and MySQL 5 on Kubuntu. I moved the same rails project from one machine to another. To set up the database I try to run `rake migrate` but I am greeted with the error/stack trace below. Any idea why this could be? It doesn''t seem to be a permissions problem--I can login to the database as my application just fine. I tried downgrading MySQL to v4.1 because that is the version that my other machine uses where `rake migrate` works, but no luck. I get the same error. Thanks in advance to all who reply. Chris ** Invoke migrate (first_time) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate rake aborted! Mysql::Error: Lost connection to MySQL server during query: SELECT version FROM schema_info /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/abstract_adapter.rb:120:in `log'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:185:in `execute'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:337:in `select'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/connection_adapters/mysql_adapter.rb:180:in `select_one'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:306:in `current_version'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:323:in `current_version'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:387:in `irrelevant_migration?'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:329:in `migrate'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:327:in `migrate'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:294:in `up'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/migration.rb:285:in `migrate'' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/tasks/databases.rake:4 /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke'' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:364:in `invoke_prerequisites'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:999:in `each'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:363:in `invoke_prerequisites'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:356:in `invoke'' /usr/lib/ruby/1.8/thread.rb:135:in `synchronize'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run'' /usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /usr/bin/rake:18 -- Posted via http://www.ruby-forum.com/.
Chris Stump wrote:> ** Invoke migrate (first_time) > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Execute db:migrate > rake aborted! > Mysql::Error: Lost connection to MySQL server during query: SELECT > version FROM schema_infoI''m having the exact same problem running migrations against MySQL 5 on Ubuntu from Rails on my Mac OSX. I''ve attempted to trace down the problem without much luck. Anyone have any ideas? -- Posted via http://www.ruby-forum.com/.
uOn Mon, Jul 17, 2006 at 03:19:05AM +0200, Chris Dempsey wrote:> Chris Stump wrote: > > ** Invoke migrate (first_time) > > ** Invoke db:migrate (first_time) > > ** Invoke environment (first_time) > > ** Execute environment > > ** Execute db:migrate > > rake aborted! > > Mysql::Error: Lost connection to MySQL server during query: SELECT > > version FROM schema_info > > > I''m having the exact same problem running migrations against MySQL 5 on > Ubuntu from Rails on my Mac OSX. I''ve attempted to trace down the > problem without much luck. Anyone have any ideas? > >I think this is due to the MySQL connector. Use : gem install mysql to fix it. At least it did the last time I had this problem. --> Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails
I''m having the same problem with Windows (so now we have all main operating systems). Though I can connect to the database via phpMyAdmin for example, it does not work for ''rake db:migrate''. ''gem install mysql'' didn''t fix it, either. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060721/d5c79b4c/attachment.html
Hi, I am having the same problem with my MS environment. I took the exact same project files and copied them to a linux host. rake migrate runs without error under linux. So there''s a workaround; copy your files to a linux host and run migrate from there. It is not pretty but it worked. -- Posted via http://www.ruby-forum.com/.