Question
DO mysql managed database pdo problem
no problem when connect via DBeaver but,
unable to connect from droplet whit pdo (php 7.2),
converted downloaded ca-certificate from crt to pem and tried both crt and pem,
PDO::MYSQLATTRSSLVERIFYSERVER_CERT tried both, true and false
same result.
$dsn = ‘mysql:’;
$dsn .= 'host=’ . $this->Host . ’;’;
$dsn .= 'port=’ . $this->DBPort . ’;’;
if (!empty($this->DBName)) {
$dsn .= 'dbname=’ . $this->DBName . ’;’;
}
$dsn .= 'charset=utf8mb4;’;
$this->pdo = new PDO($dsn,
$this->DBUser,
$this->DBPassword,
array(
PDO::ATTRERRMODE => PDO::ERRMODEEXCEPTION,
PDO::MYSQLATTRUSEBUFFEREDQUERY => true,
PDO::MYSQLATTRSSLCA => ’/var/www/html/mycert.pem’,
PDO::MYSQLATTRSSLCIPHER => 'ECDHE-RSA-AES256-SHA384’,
PDO::MYSQLATTRSSLVERIFYSERVER_CERT => true
)
);
Unhandled Exception. SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
any help?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×