I am using Ubuntu 16.04
php version : php 7.2
When tried to connect MySQL server with the yii2 application I got an error ,below pasted
Database Exception – yii\db\Exception
could not find driver
↵
Caused by: PDOException
could not find the driver
in /home/loremine/websites/rentandservices.local/vendor/yiisoft/yii2/db/Connection.php at line 719
Here I wish to connect both MySQL and SQL servers at the same time for the same application
For a set of functions,I need to connect SQL server.More specifically for two functions.Except that the entire website will connect to the MySQL database. Mysql works perfectly,but mssql server returns error
Connection string pasted here.Here I used a remote connection .Also tried with local DB.Returns the same error
‘db’ => [
‘class’ => ‘yii\db\Connection’,
‘dsn’ => ‘mysql:host=localhost;dbname=rns_staging_6’,
‘username’ => ‘root’,
‘password’ => ‘quickstart’,
‘charset’ => ‘utf8’,
‘queryCacheDuration’=>1
],
'db1' => [
'class' => 'yii\db\Connection',
'driverName' => 'sqlsrv',
'dsn' => 'sqlsrv:Server=50.201.227.146;Database=Y21',
'username' => 'lm21user',
'password' => 'Y2!ldn21amz1',
'charset' => 'utf8',
'queryCacheDuration'=>1
],
Please help