Unable to login to SQL database

387 views
Skip to first unread message

Ajay Nayak

unread,
Jul 8, 2015, 6:13:19 AM7/8/15
to rails-sqlse...@googlegroups.com
Hi All,

The database is installed on the SQLEXPRESS 2011 version. I have followed the below steps

1. Installed freetds using brew install freetds. No change done on freetds.conf file

2. Installed Tiny_TDS using gem install Tiny_TDS

3. Have written a simple database.rb file

require 'tiny_tds'
client = TinyTDS::Client.new(username: 'Domain\somename', password: 'somepassword', dataserver: 'someserver', database: 'somedatabase')
SQL=client.exec('Select * from sometable')
puts SQL

4. Execute the ruby file through terminal ruby database.rb. I get the error TinyTDS::Error: Login Failed. The login is from an untrusted domain and cannot be used with windows authentication

I have checked the default port for SQL server and its 1433, the username and password is windows credentials

Can someone please let me know if you have encountered similar issue and have a solution?

Thanks
Aj

Ken Collins

unread,
Jul 8, 2015, 8:06:17 AM7/8/15
to rails-sqlse...@googlegroups.com, ajayn...@gmail.com
Please see this issue: https://github.com/rails-sqlserver/tiny_tds/issues/94 and links.

I think windows authentication work... but there have been issues with this before. It could be required that a freetds.conf hack is needed. Wish I could help more. You could always bail out and create a SQL Server credential too.

Ajay Nayak

unread,
Jul 9, 2015, 1:26:24 AM7/9/15
to rails-sqlse...@googlegroups.com
Thanks Ken. I was able to connect to DB using the SQL server authentication not sure where the Windows authentication fails
Reply all
Reply to author
Forward
0 new messages