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)
Your database.yml seem to be missing the database
attribute. When you specify the database there, try with hostname:port/db
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.