Yii Framework compatibility with MySQL 8

Hello

I am trying to move my application from Godaddy hosting to AWS using AWS lightstail on a Linux/UNIX BITNAMI instance running on Apache server.

All the files and database have been migrated successfully to my new AWS instance and SSL certificate was successfully created using LetsEncrypt (CERTBOT) .

My Yii framework version is 1.1.17 and MySQL version on Godaddy PhpMyAdmin 5.6.43 and the application is working just fine with no connection issue .

When trying to migrate to AWS I am using AWS MySQL database (8.0.21) and was able to connect successfully to my DB with MySQL workbench but for some reason I am unable to access my site . I get error : yoursite is currently unable to handle this request.
HTTP ERROR 500.

Looking at the error logs it looks like an issue with the Yii FrameworkPHP Fatal error: Uncaught CDbException: CDbConnection failed to open the DB connection. in /opt/bitnami/apache/htdocs/yiiframework/db/CDbConnection.php

Is this an issue with MySQL 8 not being compatible with Yii 1.1.17 , if so how to resolve this issue ?

I would appreciate your help !

Thanks!

Hi @samdark

Thanks for the updates . I just would like to point out that I am not using a Docker container as the article you provided refers to and when testing my AWS Lightstail MySQL Database connection with MySQL Workbench the connection was successful showing that my AWS MySQL credentials connection database are valid and working.

The issue I am having is when trying to access my site after migrating to AWS . I am not able to access my site and I am getting a 500 error and error logs shows:

Fatal error: Uncaught CDbException: CDbConnection failed to open the DB connection. in /opt/bitnami/apache/htdocs/yiiframework/db/CDbConnection.php

My original question was if MySQL 8 is not compatible with Yii 1.1.17 and also how to resolve this error of the Yii framework CDbConnection not able to open the AWS MySQL DB connection.

Thank You !

MySQL 8 turned off usual auth protocol so solution for self-hosted platforms is to turn it on. I’m not aware about how to do it with AWS.

@samdark

Thanks for the prompt reply . Are you saying that the solution to my issue is to turn on auth protocol on my AWS instance ?

Hello @samdark

Auth protocol (mysql_native_password) has been enabled but we still getting error:
'PHP message: PHP Fatal error: Uncaught CDbException: CDbConnection failed to open the DB connection. in /opt/bitnami/apache/htdocs/yiiframework/db/CDbConnection.php:405\nStack trace:\n#0 /opt/bitnami/apache/

Anything else we could check or do to get this issue resolved ?

Thanks !

Try connecting to AWS using mysql client w/ login/password auth.