久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Rails + SQL Server:在database.yml 中放什么?

Rails + SQL Server: what to put in database.yml?(Rails + SQL Server:在database.yml 中放什么?)
本文介紹了Rails + SQL Server:在database.yml 中放什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

限時送ChatGPT賬號..

我正在嘗試將 Rails 連接到 SQL Server.我安裝了 activerecord-sqlserver-adapter 和 ruby??-odbc gems,但我不確定在我的 database.yml 文件中放什么.

I'm trying to connect Rails to SQL Server. I installed the activerecord-sqlserver-adapter and ruby-odbc gems, but I'm not sure what to put in my database.yml file.

到底什么是 DSN,我為什么需要它?(這是一些特定于 Windows 的東西嗎?)

What exactly is a DSN, and why do I need it? (Is this some windows-specific thing?)

如果我想使用 Windows 身份驗證而不是指定用戶名和密碼,該怎么辦?

What do I do if I want to use Windows Authentication, instead of specifying a username and password?

我嘗試創(chuàng)建 DSN,指定 Windows NT 身份驗證,并將以下內(nèi)容放入我的 config.yml:

I tried creating a DSN, specifying Windows NT authentication, and put the following in my config.yml:

development:
  adapter: sqlserver
  dsn: myDsn
  mode: odbc

但我收到指定的 DSN 包含驅(qū)動程序和應(yīng)用程序之間的體系結(jié)構(gòu)不匹配"錯誤.[我也嘗試從 Windows/system32/odbcad32.exe 創(chuàng)建 DSN,因為 Google 搜索說這將創(chuàng)建一個 32 位 DSN,但我得到了同樣的錯誤.]

but I get a "The specified DSN contains an architecture mismatch between the Driver and Application" error. [I tried creating the DSN from Windows/system32/odbcad32.exe as well, since a Google search said this would create a 32-bit DSN instead, but I get the same error.]

我的 database.yml 文件中是否遺漏了什么?

Am I missing something in my database.yml file?

更新:我嘗試使用

development:
  adapter: sqlserver
  mode:odbc
  dsn: Provider=SQLOLEDB; Data Source=.\SQLEXPRESS; Integrated Security=SSPI

但我收到未找到數(shù)據(jù)源名稱且未指定默認(rèn)驅(qū)動程序"錯誤.我的提供程序可能不是 SQLOLEDB 嗎?[我不知道提供程序是什么,也不知道如何確定它應(yīng)該是什么——我只是從我找到的另一個連接字符串中復(fù)制了它.] 我知道我可以使用 Windows 身份驗證從我的計算機連接到 .\SQLEXPRESS實際的 SQL Server Management Studio 程序.

but I get a "Data source name not found and no default driver specified" error. Is it possible my Provider is not SQLOLEDB? [I don't know what a provider is or how to figure out what it's supposed to be -- I just copied it from another connection string I found.] I do know that I can connect to .\SQLEXPRESS using Windows Authentication from my actual SQL Server Management Studio program.

推薦答案

DSN 是數(shù)據(jù)庫源名稱".它包含 ODBC 驅(qū)動程序連接到特定數(shù)據(jù)庫所需的信息.

A DSN is a "Database Source Name." It contains the information that an ODBC driver needs to connect to a specific database.

也許這個 SO Q&A 會幫助你:連接從 Windows 到 SQL Server 2005 的 rails 應(yīng)用程序

Perhaps this SO Q&A will help you: Connect rails application to SQL Server 2005 from Windows

另請參閱 connectionstrings.com 以獲取有關(guān)連接字符串的一般幫助.

Also see connectionstrings.com for general help with connection strings.

這篇關(guān)于Rails + SQL Server:在database.yml 中放什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

What SQL Server Datatype Should I Use To Store A Byte[](我應(yīng)該使用什么 SQL Server 數(shù)據(jù)類型來存儲字節(jié) [])
Interpreting type codes in sys.objects in SQL Server(解釋 SQL Server 中 sys.objects 中的類型代碼)
Typeorm .loadRelationCountAndMap returns zeros(Typeorm .loadRelationCountAndMap 返回零)
MS SQL: Should ISDATE() Return quot;1quot; when Cannot Cast as Date?(MS SQL:ISDATE() 是否應(yīng)該返回“1?什么時候不能投射為日期?)
Converting the name of a day to its integer representation(將一天的名稱轉(zhuǎn)換為其整數(shù)表示)
How to convert nvarchar m/d/yy to mm/dd/yyyy in SQL Server?(如何在 SQL Server 中將 nvarchar m/d/yy 轉(zhuǎn)換為 mm/dd/yyyy?)
主站蜘蛛池模板: 在线观看视频一区 | 粉嫩av久久一区二区三区 | 国产激情一区二区三区 | 免费在线性爱视频 | 欧美理论片在线 | www.99re| 超碰导航 | 日韩欧美在线观看 | 青青久在线视频 | 久草精品视频 | 日韩欧美操| 99久久久99久久国产片鸭王 | 久草在线高清 | 一级黄色录像片子 | 亚洲一区二区三区在线视频 | 国产精品美女一区二区三区 | 不用播放器看的av | 99精品久久 | 精品视频国产 | 国产精品片aa在线观看 | 美女黄18岁以下禁止观看 | 在线成人福利 | 亚洲中午字幕 | 亚洲免费在线视频 | 超级黄色一级片 | 日韩a| 涩涩视频在线观看免费 | 国产精品视频在线免费观看 | 国产欧美日韩视频 | 中文字幕一区在线观看视频 | 欧美中文字幕一区二区三区亚洲 | 久久91av | 亚洲狠狠 | 午夜免费观看 | 日本不卡一区二区三区 | 国产成人精品一区二区三区在线观看 | 久久久久国产精品一区三寸 | 五月天婷婷丁香 | 中文字幕亚洲视频 | 成人精品免费 | 99精品电影 |