Giter VIP home page Giter VIP logo

Comments (5)

yuzebin avatar yuzebin commented on August 16, 2024

补充一下:修改了两个文件:
docker-compose.yml
configs/docker-configs.toml

from webstack-go.

ch3nnn avatar ch3nnn commented on August 16, 2024

补充一下:修改了两个文件: docker-compose.yml configs/docker-configs.toml

了解, 可以把具体修改地方粘出来。我自己试了是正常运行的, 部署前可以把之前创建的容器删掉重新部署。

configs/docker-configs.toml 修改 mysql.read 和 mysql.write pass 字段

[mysql]

  [mysql.base]
    connmaxlifetime = 60
    maxidleconn = 60
    maxopenconn = 10

  [mysql.read]
    addr = "webstack-go-mysql:3306"
    name = "webstack-go"
    pass = "abc123123"
    user = "root"

  [mysql.write]
    addr = "webstack-go-mysql:3306"
    name = "webstack-go"
    pass = "abc123123"
    user = "root"

docker-compose.yml 修改 MYSQL_ROOT_PASSWORD 字段

  webstack-go-mysql:
    image: mysql/mysql-server:5.7
    container_name: webstack-go-mysql
    environment:
      MYSQL_DATABASE: webstack-go
      TZ: Asia/Shanghai
      # 允许来自其他主机的根连接
      # https://dev.mysql.com/doc/refman/5.7/en/docker-mysql-more-topics.html#docker_var_mysql-root-host
      MYSQL_ROOT_HOST: "%"
      MYSQL_ROOT_PASSWORD: abc123123
    ports:
      - "3306:3306"
    networks:
      - webstack-go
    healthcheck:
      test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
      <<: *healthcheck_defaults

from webstack-go.

yuzebin avatar yuzebin commented on August 16, 2024

感谢你的及时回复,我有空再尝试一下。

顺带说一下,我的目的是增强mysql的安全性,我换了一个方法,同样达到了目的:
只监听宿主机的127.0.0.1,不监听公网ip,同样可以增强安全性:
ports:
- "127.0.0.1:3306:3306"

from webstack-go.

ch3nnn avatar ch3nnn commented on August 16, 2024

感谢你的及时回复,我有空再尝试一下。

顺带说一下,我的目的是增强mysql的安全性,我换了一个方法,同样达到了目的: 只监听宿主机的127.0.0.1,不监听公网ip,同样可以增强安全性: ports: - "127.0.0.1:3306:3306"

也是可以, 只要服务器不对外开放公网端口也是安全的。

from webstack-go.

acche avatar acche commented on August 16, 2024

@yuzebin 修改密码的问题解决了吗?

from webstack-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.