禁用 symfony 5 数据库连接

disable symfony 5 database connection

我的 symfonu 项目中有默认配置 我在 .env 文件中有这一行

DATABASE_URL="postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=13&charset=utf8"

我收到这个错误

An exception occurred in driver: SQLSTATE[08006] [7] could not connect to server: Connection refused
Is the server running on host "127.0.0.1" and accepting
TCP/IP connections on port 5432?

当然我没有安装 postgres,我不需要这个项目的数据库,我怎么不能修复这个错误我试图评论 .env 文件行但是我得到另一个错误

按照 L3xpert 的回答建议对该行进行注释似乎无法完成工作。
它会抛出错误:
未找到环境变量:“DATABASE_URL”。

如果你不需要 Doctrine 但你安装了 Website-Skeleton,你可以通过 运行 这个命令删除 Doctrine

composer remove doctrine/doctrine-bundle doctrine/doctrine-migrations-bundle