mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-05 16:14:11 +01:00
* [FIX] Solved weird issue when connecting to MySQL DB after a successful installation. Solves #382
This commit is contained in:
@@ -134,9 +134,10 @@ class MySQLHandler implements DBStorageInterface
|
||||
}
|
||||
|
||||
try {
|
||||
$opts = [PDO::ATTR_EMULATE_PREPARES => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
|
||||
$dsn = 'mysql:host=' . $this->dbHost . ';port=' . $this->dbPort . ';dbname=' . $this->dbName . ';charset=utf8';
|
||||
// $this->db = new PDO($dsn, $dbuser, $dbpass, array(PDO::ATTR_PERSISTENT => true));
|
||||
$this->db = new PDO($dsn, $this->dbUser, $this->dbPass);
|
||||
$this->db = new PDO($dsn, $this->dbUser, $this->dbPass, $opts);
|
||||
// $this->db = new PDO($dsn, $this->dbUser, $this->dbPass);
|
||||
$this->dbStatus = 0;
|
||||
} catch (\Exception $e) {
|
||||
if ($isInstalled) {
|
||||
@@ -153,9 +154,6 @@ class MySQLHandler implements DBStorageInterface
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); //FIXME
|
||||
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
return $this->db;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user