Lynob
Lynob

Reputation: 5347

Ruby on rails: mysql error

I'm using windows xp 32 pro, bit, sp3. the latest version of railsinstaller, and mysql2 gem

i have been trying to solve this error all this week. When i run rake db:create I see this error

enter image description here

this is what i see when i trace the error

i have solved this error by downloading the zipped version of mysql Connector/C 6.0.2 for 32 bit and copying libmysql.dll from mysql-connector-c-noinstall-6.0.2-win32-vs2005\lib

to C:\RailsInstaller\Ruby1.9.2\bin

now when I run rake db:create i see

enter image description here

and this is what i see when i trace the error

i hope these info will help you, to help me solve the problem :)

@phoet

my gemfile

source 'http://rubygems.org'

gem 'rails', '3.1.1'

# Bundle edge Rails instead:
# gem 'rails',     :git => 'git://github.com/rails/rails.git'

gem 'mysql2'
gem 'cucumber'
gem 'database_cleaner'
gem 'cucumber-rails'
gem 'capybara'
gem 'rspec', '2.8'
gem 'rspec-rails', '2.8'
gem 'launchy'
gem 'spork'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
  # Pretty printed test output
  gem 'turn', :require => false
end

my db config

development:
  adapter: mysql
  database: selvista
  username: root
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql
  database: selvista_test
  username: root
  pool: 5
  timeout: 5000

production:
  adapter: mysql
  database: selvista_prod
  username: root
  pool: 5
  timeout: 5000

should my adapter be mysql2?

Upvotes: 0

Views: 576

Answers (1)

Matteo Alessani
Matteo Alessani

Reputation: 10422

You can try to put mysql2 on your adapter lines in you database.yml.

development:
  adapter: mysql2
  database: selvista
  username: root
  pool: 5
  timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql2
  database: selvista_test
  username: root
  pool: 5
  timeout: 5000

production:
  adapter: mysql2
  database: selvista_prod
  username: root
  pool: 5
  timeout: 5000

Upvotes: 2

Related Questions