现在每隔几个小时,我就在Ubuntu服务器上遇到一遍又一遍的问题。 Mysql容器突然出现“ Uknown数据库”错误。我正在使用来自php容器的cron脚本(每分钟运行一次)来解析区块链,并仅在Mysql中保存块号(其他数据进入bigQuery)。 Cron在上半场的比赛中表现良好。
有人可以提及原因吗?为什么会这样呢?谢谢!
docker-compose.yml
version: '3.5'
services:
mysql:
container_name: mysql_test
image: mysql:8.0
restart: on-failure
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
ports:
- "3306:3306"
volumes:
- ../docker_volumes/mysql/data:/var/lib/mysql
- ./docker/mysql-dump:/docker-entrypoint-initdb.d
php:
container_name: php_test
build: ./docker/php
tty: true
volumes:
- ./:/var/www/
- ./docker/volumes/symfony/var/data:/var/www/var/data
- ./docker/volumes/symfony/var/log:/var/www/var/log
depends_on:
- mysql
的屏幕截图示例
答案 0 :(得分:0)
Main thinks Main's name is: hello
Creating ClassA
Main thinks Main's name is: hello
ClassA thinks Main's name is: hello
Main changed it's name to: GoodBye
Main thinks Main's name is: GoodBye
ClassA thinks Main's name is: hello
Press any key to continue . . .
密码后,此问题已自动修复root
来禁用远程访问