How To

Setting RDS Conf In AWS Console

Login To SQL And Create User With AWSAuthenticationPlugin

mysql -h endpoint -u admin -p 

CREATE USER {dbusername} IDENTIFIED WITH AWSAuthenticationPlugin as 'RDS';
use mysql

select * from user where User = 'dbusername' ;

Setting AWS Credetial

aws configure

Get CA And Login With CA

wget https://s3.amazonaws.com/rds-downloads/rds-ca-2019-root.pem

RDSHOST="database-1.c0wfmfgasdt9.ap-south-1.rds.amazonaws.com"

TOKEN="$(aws rds generate-db-auth-token --hostname $RDSHOST --port 3306 --region ap-south-1 --username wei)"


mysql --host=$RDSHOST --port=3306 --ssl-ca=./rds-ca-2019-root.pem --enable-cleartext-plugin --user=wei --password=$TOKEN