-1

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.

Chaitanya
  • 1
  • 1

1 Answers1

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
  • Can u please help me with other solution..! – Chaitanya Apr 05 '21 at 04:23
  • 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