問(wèn)題描述
介紹.我的 Laravel 應(yīng)用程序使用的是 mysql,現(xiàn)在它需要托管在我工作的公司的網(wǎng)絡(luò)中(我是一名遠(yuǎn)程工作者).而這家公司是微軟的窺視者,所以我需要將 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 中有這個(gè)
I have this in my .env
使用php artisan migrate
錯(cuò)誤:
我正在使用 Ubuntu,這是一個(gè)專(zhuān)為我設(shè)計(jì)的遠(yuǎn)程盒子(來(lái)自我的雇主).我之前曾嘗試在我的 Laravel 應(yīng)用程序中使用 sql server(使用我的 Windows PC).據(jù)我所知,我在 xampp php.ini 中編輯了一些文本.作為 Linux 新手,這對(duì)我來(lái)說(shuō)太難了(因?yàn)槲抑皇褂?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).
已編輯(新版本)
所以我已經(jīng)獲得了從 Ubuntu 到數(shù)據(jù)庫(kù)服務(wù)器的連接.我使用了 sqlcmd -S
So I already got the connectivity from Ubuntu to the Database server. I used the the sqlcmd -S <host> -U <username>
并且我測(cè)試了查詢(例如 SELECT * from users_data
)并且它有效.
and I tested the queries (such as SELECT * from users_data
) and it works.
現(xiàn)在,我修改了 config/database.php
并添加了它.
Now, I modified the config/database.php
and I added this.
但是我遇到了一個(gè)錯(cuò)誤:
but I got an Error:
MSSQL"是我用來(lái)配置 FreeTDS 的名稱(chēng).
"MSSQL" is the name I use to configure the FreeTDS.
推薦答案
致后來(lái)者
確定你使用的 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)
司機(jī)是
您可以使用tsql確保連接信息正確
You can make sure that the connection information is correct using tsql
這篇關(guān)于Laravel 到 SQL Server (sqlsrv).[PDOException] 找不到驅(qū)動(dòng)程序的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!