Is it possible to set a password on a MariaDB/MySQL service?
Platform.sh DevRel
I have an application that throws an error if I don’t give it a password for a MySQL endpoint, but the default configuration for MySQL on Platform.sh has an empty string in the password field of the relationships variable. How can I manually add a password to this service?
0
Comments
Although it is not possible to manually set a password for a MySQL or MariaDB service, it is possible to cause Platform.sh to provide a generated password for the database endpoint. If you follow the instructions for defining multiple databases, but you only define a single endpoint, that non-default endpoint will still include a generated password.
For example:
In the above example, a database is manually defined almost identically to the default configuration block, but it will expose a generated password in the
$PLATFORM_RELATIONSHIPSenvironment variable. To use these credentials in your application, you might want to use one of our configuration reader libraries.Please sign in to leave a comment.