I am trying to make a rails 3.1 app using mysql, its my first time using it
I am getting an error when I try to rake db:create
The Error
Can't connect to local MySQL server through socket '/tmp/mysql.socket' (2) Couldnt create database for {database.yml info in here} (if you set the charset manually, make sure you have a matching collation)
I was looking at this link http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard/ which was posted in this question here rake db:create - collation issues
but I dont think that applies, doesnt mysql get installed when i do install gem mysql 'gem-version'? can someone please help me solve this error? I am also running osx 10.7
Thank you very much in advance!
This is what my gem file looks like
gem 'rails', '3.2.13'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem "mysql2"
gem "activerecord-mysql2-adapter"
gem 'pry'
gem 'pry-debugger'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
gem 'rspec-rails', '~> 2.0'
gem 'database_cleaner'
gem 'shoulda-matchers'
end
gem 'jquery-rails'
my database.yml
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: Training_development
pool: 5
username: root
password:
host: localhost
# 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
encoding: utf8
reconnect: false
database: Training_test
pool: 5
username: root
password:
host: localhost
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: Training_production
pool: 5
username: root
password:
host: localhost