How to connect CDBConnection with AWS RDS Auth Token


My server is in AWS EC2, connected to RDS using Auth Token instead of a password string.

How do I connect CDBConnection to RDS using Auth Token?

Can you explain what RDS is and may be further details for us who haven’t used it.
And then may be one can provide a pointer or some details

RDS is the SQL database in Amazon AWS

1 Like

so anyone?

Just dig a little bit dig, it seems RDS is actually mysql or mysql-like. So you connect just like any MYSQL server. See the link below for more details

so something like

$serverName = "";  //Your instance here
$username = "<USERNAME>";  
$password = "<PASSWORD>"; 
$dsn = "mysql:host={$serverName};port:3306;dbname={$dbName}";
$connection = new CDbConnection($dsn, $username, $password);
//... do some other stuffs

You can add in the config once everything works to use the db component
Let me know if that works