Linux PHP5 mssql_connect() 到 SQL Server 2005
我在 ubuntu 10.10 服务器上安装了 php5,我尝试通过 mssql_connect() 连接到在 Windows 2003 Server 上运行的 SQL Server 2005 数据库。我收到一个错误,我认为这是因为 SQL Server 2005 实例正在使用“Windows 身份验证”登录方法。错误是:
Warning: mssql_connect(): message: Login failed for user 'lv_admin'. (severity 14) in /var/www/AOI/collectserials.php on line 17
SQL Server 数据库中的错误日志显示以下内容:
Login failed for user 'lv_admin'. [CLIENT: (ip of my php server)]
Error: 18456, Severity: 14, State: 5.
其中 lv_admin 是登录到 Windows 2003 服务器的用户名,所以我不确定问题是什么...
PHP:
$con = mssql_connect("128.251.xxx.xx", 'lv_admin', '[mypass]');
mssql_select_db("itf", $con);
我需要一些帮助来解决此问题。 。
I have php5 installed on an ubuntu 10.10 server from which I am trying to connect via mssql_connect() to a SQL Server 2005 database running on a Windows 2003 Server. I am getting an error which I believe is because the SQL Server 2005 instance is using the 'Windows Authentication' login method. The error is:
Warning: mssql_connect(): message: Login failed for user 'lv_admin'. (severity 14) in /var/www/AOI/collectserials.php on line 17
The error log in the SQL Server database shows the following:
Login failed for user 'lv_admin'. [CLIENT: (ip of my php server)]
Error: 18456, Severity: 14, State: 5.
Where lv_admin is the username logged into the Windows 2003 server so I'm not sure what the problem is...
PHP:
$con = mssql_connect("128.251.xxx.xx", 'lv_admin', '[mypass]');
mssql_select_db("itf", $con);
I need some help solving this issue..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我实际上找到了我的问题。使用 Windows 身份验证,我仍然需要在 SQL Server 用户位置指定的远程脚本命令中使用用户名。一旦我在“安全”->“登录”部分将 lv_admin 添加为“SQL 身份验证”用户,我就可以获得与服务器的有效连接,但与数据库的连接失败。因此,我进入“itf”数据库->安全->用户,并在那里添加了 lv_admin 并指定了我需要的权限,并且它起作用了。希望这可以节省其他人大量的时间!
I actually figured out my problem. With Windows Authentication I still need to have the username used in the remote script commands specified in the SQL Server Users location. Once I added lv_admin as an 'SQL Authenticated' user in the Security->Logins section I could get a valid connection to the server but the connection to the database failed. So I went into the 'itf' database->Security->Users and added lv_admin there also specifying the privileges I needed and it worked. Hope this saves someone else tons of time!