[英]Error "no sqljdbc_auth in java.library.path" installing TeamCity on Windows Server 2012
I am installing TeamCity on a Windows 2012 Server.我正在 Windows 2012 服务器上安装 TeamCity。 I'm at the database connection setup screen but getting this error.
我在数据库连接设置屏幕但收到此错误。
"SQL error when doing: Taking a connection from the data source: no sqljdbc_auth in java.library.path"
“执行时出现 SQL 错误:从数据源获取连接:java.library.path 中没有 sqljdbc_auth”
I've copied the sqljdbc_auth.dll
to the C:\\Windows\\System32
folder and added a system environment variable java.library.path
that points to this folder.我已将
sqljdbc_auth.dll
复制到C:\\Windows\\System32
文件夹并添加了一个指向此文件夹的系统环境变量java.library.path
。
Teamcity installs the 32-bit version even if you're on a 64-bit platform unless you deliberately use 64-bit.即使您在 64 位平台上,Teamcity 也会安装 32 位版本,除非您故意使用 64 位。 So I am just going to give you the 32-bit instructions for using Windows authentication with Teamcity SQL database setup.
因此,我将向您提供有关在 Teamcity SQL 数据库设置中使用 Windows 身份验证的 32 位说明。 The instructions are the same for the 64-bit setup, just change x86 to x64
64 位设置的说明相同,只需将 x86 更改为 x64
<TeamCity_data_dir>\\lib\\jdbc\\sqljdbc42.jar
<TeamCity_data_dir>\\lib\\jdbc\\sqljdbc42.jar
auth\\x86\\sqljdbc_auth.dll
from the Microsoft download to <TeamCity_data_dir>\\lib\\sqljdbc_auth.dll
auth\\x86\\sqljdbc_auth.dll
从 Microsoft 下载复制到<TeamCity_data_dir>\\lib\\sqljdbc_auth.dll
-Djava.library.path=<TeamCity_data_dir>\\lib
or run setx TEAMCITY_SERVER_OPTS=-Djava.library.path=<TeamCity_data_dir>\\lib
-Djava.library.path=<TeamCity_data_dir>\\lib
或运行setx TEAMCITY_SERVER_OPTS=-Djava.library.path=<TeamCity_data_dir>\\lib
Now you can connect Teamcity to the SQL server using Windows Authentication after which the wizard will create the database.现在您可以使用 Windows 身份验证将 Teamcity 连接到 SQL 服务器,然后向导将创建数据库。
With the 2019.2.1 update I've had to move the sql_jdbcauth.dll file to <TeamCity_data_dir>\\system\\caches\\jdbc\\native\\windows-i386
This could be just a bug in the upgrade process.对于 2019.2.1 更新,我不得不将 sql_jdbcauth.dll 文件移动到
<TeamCity_data_dir>\\system\\caches\\jdbc\\native\\windows-i386
这可能只是升级过程中的一个错误。
This这个
http://www.mikeobrien.net/blog/teamcity-sqlserver-integrated-security http://www.mikeobrien.net/blog/teamcity-sqlserver-integrated-security
helped me.帮助过我。
I used the JDBC 4.1 version.我使用了 JDBC 4.1 版本。
I managed to resolve the issue by using SQL Server authentication instead of Windows authentication during the database configuration setup.我设法通过在数据库配置设置期间使用 SQL Server 身份验证而不是 Windows 身份验证来解决该问题。 Not sure why this should have fixed the error as it relates to a Java environment variable, but I can only assume that the error was generated by it's failure to login to the database and for some reason threw an unrelated error instead.
不知道为什么这应该修复错误,因为它与 Java 环境变量有关,但我只能假设错误是由于无法登录数据库而产生的,并且由于某种原因引发了一个无关的错误。
This appears to be an error with TeamCity throwing the wrong error message.这似乎是 TeamCity 抛出错误错误消息的错误。 If you get this error, try switching to SQL Server authentication.
如果出现此错误,请尝试切换到 SQL Server 身份验证。
如果您在 32 位上运行,您只需将sqljdbc_auth.dll
的 x86 版本(从 jdbc 下载)复制到<TeamCityProgramDir>\\bin
。
You should check your TeamCity server log.您应该检查您的 TeamCity 服务器日志。 Mine (located at
c:\\TeamCity\\logs\\teamcity-server.log
) mentions the following:我的(位于
c:\\TeamCity\\logs\\teamcity-server.log
)提到以下内容:
[2019-03-20 07:54:56,045] INFO - jetbrains.buildServer.STARTUP - Native library sqljdbc_auth.dll was not found under either E:\\BuildServer\\lib\\jdbc\\native\\windows-i386 or E:\\BuildServer\\lib\\jdbc\\native;
[2019-03-20 07:54:56,045] 信息 - jetbrains.buildServer.STARTUP - 在 E:\\BuildServer\\lib\\jdbc\\native\\windows-i386 或 E:\\BuildServer\\ 下找不到本机库 sqljdbc_auth.dll lib\\jdbc\\native; will continue looking in sun.boot.library.path and java.library.path.
将继续查找 sun.boot.library.path 和 java.library.path。
After putting the sqljdbc_auth.dll
library in E:\\BuildServer\\lib\\jdbc\\native\\windows-i386
and restarting the service everything was fine and dandy;将
sqljdbc_auth.dll
库放入E:\\BuildServer\\lib\\jdbc\\native\\windows-i386
并重新启动服务后一切正常; without having to meddle with bin
folders (they get reset during TC upgrades) or having to define environment variables.无需干预
bin
文件夹(它们会在 TC 升级期间重置)或定义环境变量。
In my case it didn't worked because there were some files from previous install and version TeamCity isntallation.在我的情况下,它不起作用,因为以前安装的一些文件和版本 TeamCity istallation。 I uninstalled TeamCity, deleted all TeamCity folders and installed again.
我卸载了 TeamCity,删除了所有 TeamCity 文件夹并重新安装。 Then it worked like a charm.
然后它就像一个魅力。
I was running into this issue today with TeamCity 10.x, with bundled Java, and I wanted to migrate an existing, internal, database to SQL Server.我今天在使用捆绑 Java 的 TeamCity 10.x 时遇到了这个问题,我想将现有的内部数据库迁移到 SQL Server。
TEAMCITY_SERVER_OPTS
with the value of -Djava.library.path=C:\\ProgramData\\JetBrains\\TeamCity\\lib
.TEAMCITY_SERVER_OPTS
的新系统环境变量,其值为-Djava.library.path=C:\\ProgramData\\JetBrains\\TeamCity\\lib
。TEAMCITY_MAINTAINDB_OPTS
with the same value ( -Djava.library.path=C:\\ProgramData\\JetBrains\\TeamCity\\lib
).TEAMCITY_MAINTAINDB_OPTS
系统环境变量,具有相同的值( -Djava.library.path=C:\\ProgramData\\JetBrains\\TeamCity\\lib
)。 Now you can run MaintainDB without getting an error about the sqljdbc_auth.dll not being in the JAVA library path.现在您可以运行MaintainDB 而不会出现sqljdbc_auth.dll 不在JAVA 库路径中的错误。
See Creating Backup via maintainDB command-line tool - maintainDB Startup Options for why both environment variables need to be set.请参阅通过维护数据库命令行工具创建备份 - 维护数据库启动选项,了解为什么需要设置这两个环境变量。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.