PHP PDO Connection to SQL Server with integrated security?

前端 未结 1 1872
执笔经年
执笔经年 2020-12-06 19:55

Can I connect to SQL Server 2008 using PDO and integrated security using the mssql driver? Currently doing something like this to connect normally:

$db = new         


        
相关标签:
1条回答
  • 2020-12-06 20:52

    This site helped: SQL Server Driver for PHP: Understanding Windows Authentication

    The gist of it that fixed my issue was:

    • Enable Windows Authentication
    • Disable Anonymous Authentication
    • remove the username and password from the PDO connection
    $conn = new PDO( "sqlsrv:server=$serverName ; Database=$dbName" );
    

    My testing was with the newest driver released June 2010 (SQL Server Driver for PHP 2.0 CTP2).

    0 讨论(0)
提交回复
热议问题