我有一个用Laravel3制作的工作项目,我必须切换到MSSQL Server(不过不是我说了算,嗅探.)我不理解此数据库类型上的Laravel配置.
I changed the default inside database.php
to this 'default' => 'sqlsrv'
then I configured the host, database, username, password in the sqlsrv
array but then I get this error message:
此扩展需要Microsoft SQL Server 2012本机客户端ODBC驱动程序与SQL Server通信`
经过一些研究,我发现我们需要SQLSRV的PDO,我已经有了版本5.4,在我的phpinfo
中,我得到了这个返回pdo_sqlsrv support : enabled
,所以它似乎都是正确的,但同时它似乎要求ODBC SQLSRV连接,我真的必须使用它吗?
I would rather connect directly from the Laravel database connection... but even if I need it and I created some ODBC connection to the server, how do I put them inside my configuration? Here is what I have in my configuration (of course the my...
is replace by my real details) :
'sqlsrv' => array(
'driver' => 'sqlsrv',
'host' => 'myServerIP',
'database' => 'myDatabase',
'username' => 'myUsername',
'password' => 'myPassword',
'prefix' => '',
),
Any help would be greatly appreciated, the only thing I found close to my problem was this link from the Laravel forum: Laravel query on SQL Server but then it just stop without giving any configurations.