問題描述
介紹.我的 Laravel 應用程序使用的是 mysql,現在它需要托管在我工作的公司的網絡中(我是一名遠程工作者).而這家公司是微軟的窺視者,所以我需要將 Laravel 集成到他們的 SQL Server 中.
Intro. My laravel app was using mysql, now it needs to be hosted in the network of the company I am working ( I am a remote-worker). And this company are Microsoft peeps, so I need to integrate the laravel to their SQL Server.
我的 .env 中有這個
I have this in my .env
使用php artisan migrate
錯誤:
我正在使用 Ubuntu,這是一個專為我設計的遠程盒子(來自我的雇主).我之前曾嘗試在我的 Laravel 應用程序中使用 sql server(使用我的 Windows PC).據我所知,我在 xampp php.ini 中編輯了一些文本.作為 Linux 新手,這對我來說太難了(因為我只使用 CLI).
I am using Ubuntu, a remote box dedicated for me (from my employer). I have tried using sql server in my laravel app before (using my Windows PC). As far as I remember, I edited some texts in the xampp php.ini. As a newbie Linux user, it is too hard for me (since i was using only CLI).
已編輯(新版本)
所以我已經獲得了從 Ubuntu 到數據庫服務器的連接.我使用了 sqlcmd -S
So I already got the connectivity from Ubuntu to the Database server. I used the the sqlcmd -S <host> -U <username>
并且我測試了查詢(例如 SELECT * from users_data
)并且它有效.
and I tested the queries (such as SELECT * from users_data
) and it works.
現在,我修改了 config/database.php
并添加了它.
Now, I modified the config/database.php
and I added this.
但是我遇到了一個錯誤:
but I got an Error:
MSSQL"是我用來配置 FreeTDS 的名稱.
"MSSQL" is the name I use to configure the FreeTDS.
推薦答案
致后來者
確定你使用的 PHP 版本(我家目前使用的是 php 7.1,所以我安裝了 php7.1-sybase)
Make sure of the PHP version you use (for me homestead currently using php 7.1, so I installed php7.1-sybase)
司機是
您可以使用tsql確保連接信息正確
You can make sure that the connection information is correct using tsql
這篇關于Laravel 到 SQL Server (sqlsrv).[PDOException] 找不到驅動程序的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!