致命:数据库< name>不存在
我正在尝试使用PostgreSQL
数据库创建自己的Spring Boot
应用程序。我已经开始使用docker
使用docker-compose
其值如下:
version: "3"
services:
products-postgresql:
image: postgres:9.6
restart: always
ports:
- 5450:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: superadmin
POSTGRES_DB: products
volumes:
- D:\microservicios\workspace\SpringSecurity\volumes:/var/lib/postgresql/data:rw
带有docker-compose -d
命令,我设法轻松地将其提起,
试图与dbeaver
连接到数据库时,我会出现问题。我将其配置为新的PostgreSQL
连接,传递了类似Docker-Compose的连接数据(Database
= products,host> host
= = = = = = = = = = = = = = = = = = localhost,用户
= postgres,password
= superadmin ....),但它返回致命错误:数据库“产品”不存在
。
我已经看过类似的帖子,例如 PSQL:致命:数据库“”不存在,但它们对我不起作用。 我已经证实我没有使用同一端口的任何其他应用程序。
您能告诉我我可能做错了什么,或者我还剩下什么要配置的东西?谢谢
update :图像显示容器抬起我的数据库
I am trying to create my own Spring Boot
application with a POSTGRESQL
database. I have started using docker
to mount the database, with a docker-compose
whose values are as follows:
version: "3"
services:
products-postgresql:
image: postgres:9.6
restart: always
ports:
- 5450:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: superadmin
POSTGRES_DB: products
volumes:
- D:\microservicios\workspace\SpringSecurity\volumes:/var/lib/postgresql/data:rw
With the docker-compose up -d
command, I managed to get it up easily,
The problem occurs to me when trying to connect with DBeaver
to the database. I have configured it as a new POSTGRESQL
connection, passing the connection data similar to those of docker-compose, (database
= products, host
= localhost, user
= postgres, password
= superadmin....) but it returns FATAL error: database "products" does not exist
.
I've seen similar posts, like this psql: FATAL: database "" does not exist , but they don't work for me.
I have verified that I don't have any other application using the same port.
Could you tell me what I may be doing wrong, or what I have left to configure? Thanks
UPDATE: Image showing that the container lifts my database
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管我仍然不明白为什么,但我必须将容器的端口更改为5432(Postgresql使用的端口),最终对我有用。
Although I still don't understand why, I had to change the port of my container to 5432 (the one used by POSTGRESQL), and it finally worked for me.