LoginSignup
0
0

More than 3 years have passed since last update.

docker-composeで.sqlファイルが実行されない

Posted at

エラー

コンソール
・・・
ERROR 1396 (HY000) at line 1: Operation CREATE USER failed for 'root'@'%'

原因と修正

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

MYSQL_USERrootを使っていたので、rootに変更

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0