MySQL error when running rake migrate

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:inexecute’
/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:inselect_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:incurrent_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:inmigrate’
/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:inup’
/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:inexecute’
/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:ininvoke’
/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:ininvoke’
/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:ineach’
/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:ininvoke’
/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:ininvoke’
/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:inrun’
/usr/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7
/usr/bin/rake:18

Chris S. 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?

uOn Mon, Jul 17, 2006 at 03:19:05AM +0200, Chris D. wrote:

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.

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.

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.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs