Reputation: 53
i am using two ubuntu machines, one for mysql2 server
and another one is for rails with mysql2 client
, i am in need of connecting mysql2 server
from rails app which is in another machine. i used the configuration in database.yml
:
default: &default
adapter: mysql2
encoding: utf8
pool: 5
username: root
password: dani123*
host: 192.168.1.185
port: 3306
socket: /var/run/mysqld/mysqld.sock
but while i run rake db:create
system throws the following error
. kindly help me
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>"dani123*", "host"=>"192.168.1.185", "port"=>3306, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"remotedb_development"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "username"=>"root", "password"=>"dani123*", "host"=>"192.168.1.185", "port"=>3306, "socket"=>"/var/run/mysqld/mysqld.sock", "database"=>"remotedb_test"}, {:charset=>"utf8", :collation=>"utf8_unicode_ci"}
(If you set the charset manually, make sure you have a matching collation)
Upvotes: 0
Views: 170
Reputation: 11234
Your database.yml seem to be missing the database
attribute. When you specify the database there, try with hostname:port/db
Upvotes: 1