Skip to main content

Comments

1 comment

  • Platform.sh DevRel

    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:

    db:
        type: "mariadb:10.4"
        disk: 512
        configuration:
            schemas:
              - maindb
            endpoints:
                maindb:
                    default_schema: maindb
                    privileges:
                        maindb: admin
    

    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_RELATIONSHIPS environment variable. To use these credentials in your application, you might want to use one of our configuration reader libraries.

    0

Please sign in to leave a comment.