Answer: If you want to use common database for a Ruby on Rails application running at more than one front end servers. You can do it by using grant command.
lets go step by step:
1. Server on which you want to host the database for multiple / single instances
$ mysql -u root -p
2. Granting permission of access to remote hosts:
mysql > grant all on database_name.* to root@'ip_address' identified by ' ';
To grant access to multiple front end server repeat above command by changing the ip_address to the ip_address of the front end servers.
3. Now inside your database.yaml
development: adapter: mysql2 encoding: utf8 reconnect: false database: database_name port: 3306 pool: 5 username: root password: host: ip_address_hosting_database