dongtangu6144 2017-05-04 09:39
浏览 38
已采纳

Docker MySQL数据未反映出更改

I am having some issues trying to run mysql with docker. I used this example

https://github.com/gpuenteallott/golang-mysql-docker-setup/blob/master/docker-compose.yml

Which worked like a charm. SO I could then log into sequel pro host 127.0.0.1:3306. username, password = gotest. Worked perfect. I then wanted to change the db name and login in details to I changed my docker-compose.yaml file to look like this

app_database:
    build:
      context: .
      dockerfile: docker/db/Dockerfile
    ports:
      - "3306:3306"
    environment:
      MYSQL_USER: test
      MYSQL_PASSWORD: test
      MYSQL_ROOT_PASSWORD: test
      MYSQL_DATABASE: big-website-2014
    volumes:
      - ../../../../_local_mysql_data:/var/lib/mysql

I then run every thing but I cannot seem to log in. I can still log into with the old details and old database is still there. But not any of the new data.

I have tried stoping and removing all containers and images. Rebuild , every thing still no joy.

I have also tried using the docker ip address aswell.

Can some one please educate me on this matter please and thank you.

  • 写回答

1条回答 默认 最新

  • dreamlife2014 2017-05-04 11:29
    关注

    Your MySQL Data is in host directory ../../../../_local_mysql_data. Remove that directory and then recreate your container with docker-compose up -d

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!