[英]Laravel - How to connect with sql server
I'm working in a OS X and i install a virtual box with sql server, i set the network virtual box to connect. 我在OS X上工作,并且安装了带有sql server的虚拟盒,将网络虚拟盒设置为可连接。
In mac i install the freetds and if i do this command it connect: 在Mac中,我安装freetds,如果执行此命令,它将连接:
The laravel connection is this: laravel连接是这样的:
'dbname' => [
'driver' => 'sqlsrv',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '2222'),
'database' => env('DB_DATABASE', 'dbname'),
'username' => env('DB_USERNAME', 'xpto'),
'password' => env('DB_PASSWORD', 'xpto1234'),
'charset' => 'utf8',
'prefix' => '',
],
When i run laravel i have the error could not find driver
. 当我运行laravel时,出现错误
could not find driver
。
In phpinfo()
i have mssql extension but don't have sqlsrv
. 在
phpinfo()
我具有mssql扩展名,但没有sqlsrv
。
To make the installations I was guided by this link: https://pt.stackoverflow.com/questions/529/como-utilizar-o-freetds-com-mamp-no-mac-os 要进行安装,我受到此链接的指导: https : //pt.stackoverflow.com/questions/529/como-utilizar-o-freetds-com-mamp-no-mac-os
What is the problem? 问题是什么?
Thank you. 谢谢。
Are you set your app from .env file? 您是从.env文件设置应用程序吗? if you dont know where is in your root app folder.
如果您不知道根应用程序文件夹中的位置。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.