0

I'm having trouble connecting a PHP application to the AWS database.

I'm new to PHP and cannot solve this problem.

I'm getting this error:

Error: A Database connection using "Mysql" was missing or unable to connect. The database server returned this error: SQLSTATE[HY000] [2054] Server sent charset unknown to the client. Please, report to the developers

That's my database.php

public $default = array(
                'datasource' => 'Database/Mysql',
                'persistent' => false,
                'host'           => 'mydb-prod-db.sdssd.us-east-2.rds.amazonaws.com',
                'login'      => 'admin',
                'password'   => 'mypassword',
                'database'   => 'mydatabase_prod_db',
                'prefix'     => '',
                'encoding'   => 'utf8',
                //'encoding' => 'utf8',
                //'char_set' => 'utf8mb4',
                //'dbcollat' => 'utf8mb4_unicode_ci',
        );

And this is the result of show variables like 'character%';

enter image description here

And this is the result of show variables like 'collation%';

enter image description here

I'm using cakephp/cakephp-codesniffer": "^1.0.0" and my RDS is MySQL version 8.0.28.

In the encoding field, I've tried utf8, utf8mb4, and utf8mb3, in addition to uncommenting the commented fields. All of this without success...

Would you know how I can solve this problem?

Gustavo Rey
  • 115
  • 9
  • **https://stackoverflow.com/questions/43437490/pdo-construct-server-sent-charset-255-unknown-to-the-client-please-rep** – ndm Oct 11 '22 at 18:33

0 Answers0