.sql file does not run in docker-compose

error

console


・ ・ ・
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%'

Cause and correction

docker-compose.yaml


version: "3"
services:
  mysql:
・ ・ ・
    volumes:
      - mysql-data:/var/lib/mysql
      - ./build/mysql/init:/docker-entrypoint-initdb.d
    environment:
      MYSQL_DATABASE: sample
      MYSQL_USER: test # root -> test
      MYSQL_PASSWORD: test
      MYSQL_ROOT_PASSWORD: test
      TZ: Asia/Tokyo

I used root for MYSQL_USER, so I changed it to root

Recommended Posts

.sql file does not run in docker-compose
Run raw sql in Hanami to get results not in columns
Container does not start with docker-compose
Addressing an issue where cron-driven docker (docker-compose) exec does not run
JavaScript (vanilla) does not respond in Rails.
MySQL container does not start in Docker
Do not accept System.in in gradle run
File manager does not start when logging in again in Docker's LXDE desktop environment
@BeforeStep does not work in Tasklet of spring-batch
Localhost3000 does not start up in Docker / Rails development.
When Docker for Mac 2.4.0.0 does not reflect file changes
Correspondence when Ruby version does not switch in rbenv
Java11: Run Java code in a single file as is
Hivernate Validator does not work in WAS Liberty environment
Terminal does not start
When I run docker-compose exec in crontab, I get "the input device is not a TTY"
Sidekiq-limit_fetch does not work
E: The repository'http://ppa.launchpad.net/daniel.pavel/solaar/ubuntu focal Release' does not have a Release file.
Docker does not work when DOCKER_HOST is specified in WSL2