Dharmdip Rathod
Dharmdip Rathod

Reputation: 11

Database connection to remote machine in ruby on rails

Here is strange problem.

databse server ip : 170.2.14.131

application server ip : 170.2.14.137

Application is on cloud server. Database server is on another instance and application hosted on different instance.

production:
  adapter: mysql
  database: database_name
  username: ************
  password: ************
  host: 170.2.14.131

This is my database.yml configuration for production environment.

Now when i am trying to connect through my application it's using application server IP instead of remote databse IP.

Please suggest.

Upvotes: 0

Views: 1779

Answers (1)

Said Kaldybaev
Said Kaldybaev

Reputation: 9962

By default, MySQL database server remote access disabled for security reasons. there're 3 solutions to this problem, i'll not describe them here, you can read about it in my blog here: http://notes.kloop.kg/2011/11/17/enable-remote-access-to-mysql-database-server/

Upvotes: 1

Related Questions