sql files in /docker-entrypoint-initdb.d not executing, ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for ‘root’@’%’

https://stackoverflow.com/questions/45086162/docker-mysql-error-1396-hy000-operation-create-user-failed-for-root

this answer is right but it applies differently to my situation. in my .env file

docker cp <db container>:/usr/local/bin/docker-entrypoint.sh /entrypoint.sh

when “docker_setup_db” function gets called, the container attempts to create a user with the name MYSQL_USER (root). Since root is the default user, the error above gets thrown, causing no files inside of /docker-entrypoint-initdb.d to get executed.

to fix change

Leave a Reply

Your email address will not be published.