Report this

What is the reason for this report?

DO mysql managed database pdo problem

Posted on September 9, 2019

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::MYSQL_ATTR_SSL_VERIFY_SERVER_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::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true, PDO::MYSQL_ATTR_SSL_CA => ‘/var/www/html/mycert.pem’, PDO::MYSQL_ATTR_SSL_CIPHER => ‘ECDHE-RSA-AES256-SHA384’, PDO::MYSQL_ATTR_SSL_VERIFY_SERVER_CERT => true ) );

Unhandled Exception. SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

any help?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.