Connecting to external MySQL in ruby. ERROR 1130 (HY000)

227 views Asked by At

I know that there are bunch of similar topics created, however, they do not answer my issue.

I started with a simple example to connect to my already created MySQL data. This is that I am working with:

require 'mysql2'

client = Mysql2::Client.new(:host => "dbIP_addr", :username => "db_usern", :password => "db_passw", :database => "db_name")

puts client

Unfortunately, I am getting an error:

ERROR 1130 (HY000): Host 'myIP_addr' is not allowed to connect to this MariaDB server

I followed several examples and they didn't help me. "Allow remote connections to your MySQL server" is the most understandable to me.

As I still have this issue, I need your help to help me understand where the problem is.

Appreciate your help.

1

There are 1 answers

1
winmutt On

You don't have a 'db_usern' user that matches the source IP/dns (you should turn off PTR lookups for host auths).