【问题标题】:Connect Symfony 2 application to SQL SERVER using windows account使用 windows 帐户将 Symfony 2 应用程序连接到 SQL SERVER
【发布时间】:2016-09-26 13:55:14
【问题描述】:

我正在尝试将我的 symfony 2 应用程序连接到 SQL SERVER 数据库,使用 SQL SERVER 内部帐户一切正常,但我需要通过 Windows 帐户连接我的应用程序来避免这种情况(例如使用运行的 Windows 用户Web 服务器上的 apache 服务)。

有什么想法吗?

我尝试注释用户/密码参数

这个文件是在 composer 安装过程中自动生成的

parameters:
    database_driver: pdo_sqlsrv
#    database_host: xxxxx
    database_host: x.x.x.x
    database_port: 1557
    database_name: xxxxxx
#    database_user: xxxxx
#    database_password: "xxxxx"

但我得到了这个错误:

Fatal error: Uncaught exception 
'Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException'
enter code here
 with message 'You have requested a non-existent parameter "database_user". 
Did you mean one of these: "database_driver", "database_host", 
"database_port", "database_name"?' in ...

【问题讨论】:

    标签: php sql-server symfony


    【解决方案1】:

    我找到了解决方案:只需将 database_user 和 database_password 保留为 null :

    database_user: null 
    database_password: null
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-13
      • 2015-10-20
      • 1970-01-01
      • 2013-07-13
      • 2013-03-23
      • 1970-01-01
      相关资源
      最近更新 更多