2020-05-11T15:48:56.348312Z 8 [Warning] [MY-010055] [Server] IP ...

问题描述 投票:0回答:1
I fixed it updating the mysql version to 8.0.20 and adding the following lines to my "my.cnf" file.

So my file is like that now

mysql      | 2020-05-11T15:48:56.348312Z 8 [Warning] [MY-010055] [Server] IP address '172.21.0.1' could not be resolved: Name or service not known

我的问题有点奇怪。

$ docker-compose exec php-fpm php artisan migrate

当我把我的容器建立起来后,我无法通过任何数据库管理器连接到我的数据库。

  #MySQL Service
  mysql:
    image: mysql:8
    container_name: mysql
    restart: unless-stopped
    tty: true
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: database
      MYSQL_ROOT_PASSWORD: root
      SERVICE_TAGS: dev
      SERVICE_NAME: mysql
    volumes:
      - ./mysql/dbdata:/var/lib/mysql/
      - ./mysql/my.cnf:/etc/mysql/my.cnf
    networks:
      - app-network

但当我用上面的命令在终端执行迁移后,我可以通过任何数据库管理器正常访问我的数据库。

[mysqld]
general_log = 1
general_log_file = /var/lib/mysql/general.log
secure-file-priv= NULL
#Accept connections from any IP address
bind-address = 0.0.0.0
我的 docker-compose.yml
docker mysql-8.0
1个回答
0
投票

sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
character-set-server=utf8
default-authentication-plugin=mysql_native_password

我的问题很奇怪,当我建立了我的容器,我不能通过任何数据库管理器连接到我的数据库。我得到的是mysql

© www.soinside.com 2019 - 2024. All rights reserved.