0

I am trying to create an app that use mysql. I create the project has follow:

rails new appname -d mysql

I then when into the folder and did bundle install. and run the app has follow passenger start

Now this did work for a basic app, it gave me a typical rails app index.html. Which his fine although i then try to upload my version of rails into it, which works on my localmachine change the database.yml to my configuration with a username and stuff like that. Although if I try to run rake db:create RAILS_ENV=production and then i get the following error:

Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnect"=>false, "database"=>"domain_production", "pool"=>5, "username"=>"root", "password"=>"****", "host"=>"localhost"}, charset: , collation:Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) 

I also removed the index.html to have my own and i get a file list of my public folder.

Jseb
  • 1,926
  • 4
  • 29
  • 51
  • I am confused. If you work on your local machine, wouldn't you create the database with simply: 'rake db:create'? The reason is not working would be maybe in the wrong socket (usually different between development and production?) Not sure – Paola Cerioli Dec 18 '12 at 04:03
  • 2
    Problem is with your charset.Please refer this question http://stackoverflow.com/questions/1432384/error-when-trying-to-create-database-with-rails-rake-dbcreate – Cyber Dec 18 '12 at 04:23
  • Can you post the database.yml code. Then I can help you. – VenkatK Dec 18 '12 at 04:49
  • It did works, you are awsome, i also realize my data was wrong but removing the utf made magic. If you want you could put an answer and a good database.yml has an example but it make magic has i said – Jseb Dec 18 '12 at 04:59

0 Answers0