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.

4
  • 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 Commented Dec 18, 2012 at 4:03
  • 2
    Problem is with your charset.Please refer this question stackoverflow.com/questions/1432384/… Commented Dec 18, 2012 at 4:23
  • Can you post the database.yml code. Then I can help you. Commented Dec 18, 2012 at 4: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 Commented Dec 18, 2012 at 4:59

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.