【发布时间】:2013-06-19 06:54:48
【问题描述】:
这似乎是一个相当普遍的问题,但查看其他相关线程的帮助和解决方案对我没有帮助。
我在这里使用 PHP 代码块 (http://pastebin.com/xSJYyC3y) 来尝试连接和查询 SQL Server 数据库。连接似乎有效,但在进行查询时,我收到以下错误消息:
[Microsoft][SQL Server Native Client 11.0][SQL Server]The server principal "my_username" is not able to access the database "database_name" under the current security context.
我只在通过 PHP 连接到服务器时出现此错误,如果我通过 MS SQL Management Studio 手动执行此操作,则一切正常。
我使用的是 Windows 7 x64、SQL Server 2008 SP1 x64 和 PHP 5.4。
感谢您查看我的问题!
【问题讨论】:
标签: php sql-server