rails-sqlserver / tiny_tds

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

TinyTds::Error: Cannot open user default database. Login failed. #44

Closed jacob-carlborg closed 13 years ago

jacob-carlborg commented 13 years ago

I'm trying to use TinyTds to connect to an sql server using Ruby on Rails. This is how my database.yml file look like:

development: adapter: sqlserver mode: dblib dataserver: 192.168.1.13 database: username: password: *** timeout: 5000

I know that the username, password and database is correct but I cannot get it to work. The error message I get is:

TinyTds::Error: Cannot open user default database. Login failed.

I'm using TinyTds 0.4.5 and Ruby on Rails 3.1rc5 on Mac OS X.

metaskills commented 13 years ago

What version of FreeTDS?

jacob-carlborg commented 13 years ago

I've tested with both 0.82 and 0.91RC2.

jacob-carlborg commented 13 years ago

Ok, I found the problem. The user account had a default database that didn't exist anymore. I don't know if this should be consider a bug or not but I have specified a database in the database.yml file and would think it would work without any default database.

metaskills commented 13 years ago

Yea, this sounds like what SQL Server does, out of our hands. Glad you found the issue.

jacob-carlborg commented 13 years ago

But the thing is that I've been using ODBC and Rails 2 to connect to the same database with the same user account and it works even though the default database doesn't exist.

metaskills commented 13 years ago

DBLIB is a different protocol.

jacob-carlborg commented 13 years ago

Ok, thanks for the clarification.