rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
606 stars 189 forks source link

"Cannot open server " Can't connect with `tiny_tds` but can with SQLPro desktop app. #446

Closed AlexJWayne closed 4 years ago

AlexJWayne commented 4 years ago

Environment

Operating System

ProductName:    Mac OS X
ProductVersion: 10.15
BuildVersion:   19A583

TinyTDS Version and Information

tiny_tds (2.1.2)

FreeTDS Version

Compile-time settings (established with the "configure" script)
                            Version: freetds v1.1.15
             freetds.conf directory: /usr/local/etc
     MS db-lib source compatibility: no
        Sybase binary compatibility: yes
                      Thread safety: yes
                      iconv library: yes
                        TDS version: 7.3
                              iODBC: no
                           unixodbc: yes
              SSPI "trusted" logins: no
                           Kerberos: yes
                            OpenSSL: yes
                             GnuTLS: no
                               MARS: yes

Description

I can connect to my azure hosted database with the SQLPro for MSSQL desktop app, but with the exact same credentials on the same computer, I get this error.

.../gems/tiny_tds-2.1.2/lib/tiny_tds/client.rb:60:in `connect': Cannot open server
  'my-server-here' requested by the login. Client with IP address 'my.ip.is.here'
  is not allowed to access the server.  To enable access, use the Windows Azure
  Management Portal or run sp_set_firewall_rule on the master database to create
  a firewall rule for this IP address or address range.  It may take up to five
  minutes for this change to take effect. (TinyTds::Error)
from .../gems/tiny_tds-2.1.2/lib/tiny_tds/client.rb:60:in `initialize'

Why would that desktop app work, but not tiny_tds?

AlexJWayne commented 4 years ago

I'm an idiot... Disregard lol!

harssh commented 2 months ago

@AlexJWayne Same issue for me. What was the solution for you ?

AlexJWayne commented 2 months ago

@harssh Sorry man, no idea! I haven't written any ruby in years.

Pretty sure I just had the password wrong or something.