Reputation: 75
I'm having trouble connecting to a remote mysql db with mysql2 gem.
I get this error:
Host 'my_ip' is not allowed to connect to this MySQL server
My db.yml says:
remote_development:
adapter: mysql2
reconnect: false
host: host_ip
encoding: utf8
database: host_db
pool: 5
username: root
password:
And when I try to connect via my sql or telnet I have no problems at all. I've double and triple checked the data con my yml, but can't get through this. Any idea?
Btw I'm using Rails 3.2.3, Ruby 1.9.3, and tried mysql2 v 0.2.18 and 0.3.11 ... pls HELP!
Upvotes: 1
Views: 1812
Reputation: 75
I solved this, pretty simple...
I just created a new user and password to the db with specific permissions instead of using root :)
Should have tried this from the beginning. I think this is the correct approach.
Upvotes: 2
Reputation: 98
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: mystore_development
pool: 5
username: root
password:password
host: localhost
try this one surely it wil work...
Upvotes: 0
Reputation: 26
This seems to be a MySQL error message. I think the problem may be the user account that you are using. It should be set up with the 'username'@'%'
format when setting it up. The percent sign means all ip addresses. You should then flush privileges
on the server to make the account available.
Upvotes: 0