如何为托管在 platform.sh 的 Symfony 项目设置数据库密码?
How to set up database password for a Symfony project hosted at platform.sh?
我有一个 Symfony 3 项目,托管在 platform.sh。作为默认配置,它们为我提供了一个不受密码保护的数据库连接。我在文档中找到了以下几行,但无法理解它们的真正含义:
In either case, you will also need the service credentials. For that, run platform relationships. That will give output similar to the following:
database:
-
username: user
scheme: mysql
service: mysqldb
ip: 120.0.80.37
cluster: yuh7waly3uu6n-master-7rqtwti
host: database.internal
rel: mysql
path: main
query:
is_master: true
password: ''
port: 3306
That indicates that the database relationship can be accessed at host database.internal, user user, and an empty password. The path key contains the database name, main. The other values can be ignored.
写在这里:https://docs.platform.sh/configuration/services.html#obtaining-service-credentials
这是否意味着如果我想更改这些凭据,我需要在 services.yaml 文件中输入正确的密码,或者这只是服务器尝试连接的一种方式。如何将此空密码更改为安全密码?可以通过环境变量解决还是services.yaml改变的方法是正确的?
在与支持人员长时间交谈后,我意识到在非高级帐户中不可能。他们要求我更改类型,这是解决此问题的唯一方法。
我有一个 Symfony 3 项目,托管在 platform.sh。作为默认配置,它们为我提供了一个不受密码保护的数据库连接。我在文档中找到了以下几行,但无法理解它们的真正含义:
In either case, you will also need the service credentials. For that, run platform relationships. That will give output similar to the following:
database:
-
username: user
scheme: mysql
service: mysqldb
ip: 120.0.80.37
cluster: yuh7waly3uu6n-master-7rqtwti
host: database.internal
rel: mysql
path: main
query:
is_master: true
password: ''
port: 3306
That indicates that the database relationship can be accessed at host database.internal, user user, and an empty password. The path key contains the database name, main. The other values can be ignored.
写在这里:https://docs.platform.sh/configuration/services.html#obtaining-service-credentials
这是否意味着如果我想更改这些凭据,我需要在 services.yaml 文件中输入正确的密码,或者这只是服务器尝试连接的一种方式。如何将此空密码更改为安全密码?可以通过环境变量解决还是services.yaml改变的方法是正确的?
在与支持人员长时间交谈后,我意识到在非高级帐户中不可能。他们要求我更改类型,这是解决此问题的唯一方法。