0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

LaradockでLaravelの環境構築するもMysqlが立ち上がらない!

Last updated at Posted at 2020-01-19

開発環境

  • macOS Mojave 10.14.4
  • Laravel6.(php7.3以上)
  • Mysql8.

環境構築:参考記事
初心者でもLaradockでLaravelの環境構築をエラーなしで行おう!(Mac ver)


初心者なりに環境構築で詰まったところを共有します。
記事を参考に進めていく途中

docker-compose up -d nginx mysql phpmyadmin

mysqlが立ち上がらない
Docker再起動しても立ち上がらない!
困った!

エラー内容

Recreating laradock_mysql_1            ... error
ERROR: for mysql  Cannot start service mysql:
driver failed programming external connectivity on endpoint 
laradock_mysql_1(aa02fd7a36f486c3c62720a98798b7625cd855e49b5c4ef25b26a425e1299e0c): 
Error starting userland proxy: listen tcp 0.0.0.0:3306: bind: address already in use

3306が既に使われているってことか?

ググる...

Laradock公式にこんな記述が

スクリーンショット 2020-01-19 23.37.45.png

docker-compose.ymlの中のports欄を消せばよいとのお告げ

docker-compose.yml
### MySQL ################################################
    mysql:
      build:
        context: ./mysql
        args:
          - MYSQL_VERSION=${MYSQL_VERSION}
      environment:
        - MYSQL_DATABASE=${MYSQL_DATABASE}
        - MYSQL_USER=${MYSQL_USER}
        - MYSQL_PASSWORD=${MYSQL_PASSWORD}
        - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
        - TZ=${WORKSPACE_TIMEZONE}
      volumes:
        - ${DATA_PATH_HOST}/mysql:/var/lib/mysql
        - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
      ports:
        - "${MYSQL_PORT}:3306"
      networks:
        - backend

ports: - "${MYSQL_PORT}:3306"
これを削除してみる...

再度docker-compose up -d nginx mysql phpmyadmin

スクリーンショット 2020-01-19 23.43.06.png

できた!ありがとうLaradock公式!!

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?