Following is mysql part of docker-compose.yml file :
db:
image: mysql:8.0
ports:
- "3306:3306"
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_DATABASE: myDb
MYSQL_USER: root
MYSQL_PASSWORD: ''
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD : 'yes'
restart: always
volumes:
- ./dump:/docker-entrypoint-initdb.d
- ./conf:/etc/mysql/conf.d
- persistent:/var/lib/mysql
networks:
- default
Now, I don't know for what weird reason, but the mysql has added "docker" as user which doesn't have access to create / drop databases. I suspect, this is because of my earlier trial setup which had user named 'docker' in it and the same is getting carried forwarded for mysql. The command 'docker-compose up -d' seems not resetting the mysql image and user "root" is not getting created.
Is there any ways I could add this user "root" ? Since don't have root access so can't even know if there is any root user added already. I tried "docker-compose exec db mysql -u root -p" with "root" as password, says access denied... with blank password, says access denied...
Any help please ?
Thanks