Connect to HeidiSAQL DB Problem

witgrefe

New Member
Joined
Apr 19, 2020
Messages
2
Reaction score
0
Credits
11
I am trying to connect to a HeidiSQL db using php PDO on a linux mint 19.3 machine. I cannot. This is the code I am using:


$dsn = "mysql:host=$host;dbname=$db;charset=$charset";

try {
$conn = new PDO("mysql:host=$severname;dbname=$db", $user, $pass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo "Connected successfully";
}
catch(PDOException $e) {
echo "Connection failed:". '</br>' . $e->getMessage();

The error returned is: could not find driver


Can someone help please, I have spent hours trying to find a solution on the Internet, but to no avail.
 

Members online


Top