I am using three containers(Mysql, nginx, php) All the containers are running perfectly fine but when entered data has to be saved in DataBase I am getting access denied error. I have checked multiple times that the username and password are mentioned correctly both in .env file and docker-compose.yml. Can anyone help me to figure out this. Thanks a lot in advance.
Asked
Active
Viewed 979 times
-1
-
https://stackoverflow.com/questions/42496917/sqlstatehy000-1045-access-denied-for-user-usernamelocalhost-using-pass – Midhun Raj Apr 04 '21 at 10:29
-
https://stackoverflow.com/questions/63116652/sqlstatehy000-1045-access-denied-for-user-rootlocalhost-using-password – Pooriya Mostaan Apr 04 '21 at 11:45
1 Answers
1
if you’re using mysql make sure you already grant access first for ‘root’ user. or you can make a new user and grant access to the db. if you still want using root user, you probably have to change password of root user using ALTER function

shinji29
- 97
- 6
-
-
do you setting the docker from scratch or what? i'm using [laradock](https://laradock.io/) to implement laravel with docker. You need to use the Laradock’s default DB credentials which can be found in the .env file (ex: MYSQL_USER=). Or you can change them and rebuild the container. – shinji29 Apr 05 '21 at 06:23