I have tried many solutions found in stack overflow but still struggling with this problem. The problem is that:
- First I have whitelisted my IP to the security group, and public accessibility is Yes. Even I made all traffic access true in the security group.
- Then I tried to connect RDS Mysql from my PC's terminal by following command mysql -h ************.rds.amazonaws.com --port=3306 -u username -p Then I successfully connected to the mysql.
- But when I try to connect the RDS MySQL database from laravel application from my same PC, it says "SQLSTATE[HY000] [1045] Access denied for user 'username'@'my-pc-ip' (using password: YES) (SQL: select count(*) as aggregate from
students
)" - I wondered why it is saying username@my-pc-ip instead of username@rds-mysql-host?
.env file
DB_HOST=*******.rds.amazonaws.com
DB_PORT=3306
DB_CONNECTION=mysql
DB_DATABASE=mydb
DB_USERNAME=username
DB_PASSWORD=mypassword
I have also configured the database.php in the config folder.
Any help, please??
I have also same problem from my hosting vps. I also whitelisted my vps's ip in security group and when i tries to connect the mysql from my vps server(not in aws) then it says same problem access denied username@vps-ip.
Any help would be highly appreciated.