I am using Windows 10 and using Laravel to connect to my Microsoft SQL Server 2012 Express edition.
I have the .erv file as following:
DB_CONNECTION=sqlsrv
DB_HOST=W1234567\SQLEXPRESS
DB_PORT=1433
DB_DATABASE=My_Database_Name
DB_USERNAME=sa
DB_PASSWORD=My_Password
The given details are correct but when I am running a simple query I am getting following error message in my Laravel Model
:
(3/3) QueryException
could not find driver (SQL: SELECT COUNT(*) AS count FROM TBL_Data
WHERE ACTIVE_IND = 1
)
I have the WAMP running properly, I have added the SQLSRV
file to my WAMP.
The entire thing was working fine, now I moved the code to different system there I am getting this error (Both the system has the same credentials only change is the Server name which I have changed) so the code should work properly as there are no changes done.
I tried checking the SQL Server TCP/IP port number in SQL Server Configuration Manager
and changed it to 1433 still no luck.
I checked most of the answers here and they belong to PDO exception and asked people to uncomment the part extension=php_pdo_mysql.dll
but in my case its SQL Server and normal wamp is working perfectly only seems to be problem with LARAVEL.
Can anyone provide the solutions for this?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire