我无法将MSSQL数据库连接到我的rails应用程序

时间:2021-10-23 22:26:20

I am attempting to connect a clients database to a rails app I am developing for them. They are using MSSQL for their database. I am able to connect to it thanks to Tiny-tds but when I run rake:db migrate I get the following message:

我正在尝试将客户端数据库连接到我正在为他们开发的rails应用程序。他们正在使用MSSQL作为他们的数据库。我能够通过Tiny-tds连接到它,但是当我运行rake时:db migrate我收到以下消息:

TinyTds::Error: Database 'MSSQL' does not exist. Make sure that the name is entered correctly.

TinyTds ::错误:数据库'MSSQL'不存在。确保正确输入名称。

The database does exist.

数据库确实存在。

Here is what I have in my database.yml:

这是我在database.yml中的内容:

development:
    adapter: sqlserver
    host: *.*.*.*.*
    port: 1433
    database: MSSQL
    username: username
    password: not the real password

Does anyone have an idea as to why it doesn't recognize that the database exists?

有没有人知道为什么它不能识别数据库存在?

1 个解决方案

#1


1  

The database field in the configuration is the name of the logical database that you are connecting to. This error means that there is no logical database named 'MSSQL' for the given connection.

配置中的数据库字段是要连接的逻辑数据库的名称。此错误意味着给定连接没有名为“MSSQL”的逻辑数据库。

#1


1  

The database field in the configuration is the name of the logical database that you are connecting to. This error means that there is no logical database named 'MSSQL' for the given connection.

配置中的数据库字段是要连接的逻辑数据库的名称。此错误意味着给定连接没有名为“MSSQL”的逻辑数据库。