我用 PostgreSQL 创建了一个 laravelsai 项目,然后我尝试在 3rd 方软件(TablePlus 和 Navicat)上连接服务器,我收到了这个错误消息
FATAL: password authentication failed for user "sail"
这是我的 docker-compose.yml
pgsql:
image: 'postgres:13'
ports:
- '${FORWARD_DB_PORT:-5432}:5432'
environment:
PGPASSWORD: '${DB_PASSWORD:-secret}'
POSTGRES_DB: '${DB_DATABASE}'
POSTGRES_USER: '${DB_USERNAME}'
POSTGRES_PASSWORD: '${DB_PASSWORD:-secret}'
volumes:
- 'sailpgsql:/var/lib/postgresql/data'
networks:
- sail
healthcheck:
test: ["CMD", "pg_isready", "-q", "-d", "${DB_DATABASE}", "-U", "${DB_USERNAME}"]
retries: 3
timeout: 5s
这是我的环境
DB_CONNECTION=pgsql
DB_HOST=pgsql
DB_PORT=5432
DB_DATABASE=laravel
DB_USERNAME=sail
DB_PASSWORD=password
这是一个全新的安装,我什么都没改变。它与 MySQL 一起工作,我错过了什么吗?谢谢你..