我正在尝试从 迁移mariaDB
到postgres
通过pgLoader
我的电脑上运行着两个数据库
mariadb on 127.0.0.1 pass:pass user:app
postgres on 127.0.0.1 pass:pass user:app
我运行了命令,但什么也没发生。docker 日志中没有连接,无论是 mariadb 还是 postgres;任何地方都没有任何错误。脚本显然只是在建立连接时挂起了。pgloader mysql://app:[email protected]/mr_dev postgresql://app:[email protected]/mr_dev
但我可以使用Sequel Pro
和PostBird
在同一个地址访问它们,所以我知道我的数据库是在线并且可以访问。
那么为什么我没有收到来自脚本的连接?或者是 pgloader 配置不正确?
database:
container_name: database
image: postgres
restart: always
ports:
- 5432:5432
networks:
app_network:
environment:
POSTGRES_PASSWORD: pass
POSTGRES_USER: app
POSTGRES_DB: mr_dev
volumes:
- type: bind
source: ./volumes/database/postgres
target: /var/lib/postgresql/data
mariadb:
container_name: mariadb
image: "mariadb:${MARIADB_VERSION}"
restart: always
env_file: .env
volumes:
- "${SQL_INIT}:/docker-entrypoint-initdb.d"
- type: bind
source: ${MARIADB_DATA_DIR}
target: /var/lib/mysql
- type: bind
source: ${MARIADB_LOG_DIR}
target: /var/logs/mysql
- type: bind
source: ${MARIADB_CERTS_DIR}
target: /etc/certs/
- type: bind
source: /etc/localtime
target: /etc/localtime:ro
- type: bind
source: ${MARIADB_BACKUP_DIR}
target: /opt/mysql/backup
- type: bind
source: ${MARIADB_BACKUP_SCRIPT_DIR}
target: /etc/periodic/daily
ports:
- "3306:3306"
networks:
app_network: