--- title: "PostgreSQL" description: "Learn how to dynamically generate PostgreSQL Database user passwords." --- The Infisical MySQL secret rotation allows you to automatically rotate your MySQL database user's password at a predefined interval. ## Prerequisite 1. Create a user with the required permission in your SQL instance. ## Set up Dynamic Secrets with PostgreSQL Open the Secret Overview dashboard and select the environment in which you would like to add a dynamic secret. ![Add Dynamic Secret Button](../../../images/platform/dynamic-secrets/add-dynamic-secret-button.png) ![Dynamic Secret Modal](../../../images/platform/dynamic-secrets/dynamic-secret-modal.png) Name by which you want the secret to be referenced Default time-to-live for a generated secret (it is possible to modify this value when a secret is generate) Maximum time-to-live for a generated secret Choose the service you want to generate dynamic secrets for Database host Database port Username that will be used to create dynamic secrets Password that will be used to create dynamic secrets Name of the database for which you want to create dynamic secrets A CA may be required if your DB requires it for incoming connections. AWS RDS instances with default settings will requires a CA which can be downloaded [here](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL.html#UsingWithRDS.SSL.CertificatesAllRegions). ![Dynamic Secret Setup Modal](../../../images/platform/dynamic-secrets/dynamic-secret-setup-modal.png) If you want to provide specific privileges for the future generated dynamic secrets, you are able to specify them as SQL statements. ![Modify SQL Statements Modal](../../../images/platform/dynamic-secrets/modify-sql-statements.png) After submitting the form, you will see a dynamic secret creates in the dashboard. If this step fails, you might have to add the CA certficate. ![Dynamic Secret](../../../images/platform/dynamic-secrets/dynamic-secret.png) Now that the dynamic secret is created, you can start generating unique secret values by specifying the Time-to-live within the predefined range. ![Provision Lease](../../../images/platform/dynamic-secrets/provision-lease.png) After you click the `Submit` button, a new secret lease will be generated and the Database User and Database Password will be shown. ![Provision Lease](../../../images/platform/dynamic-secrets/lease-values.png) As soon as you have generated a few secret leases, you will be able to access them by clicking `Generate` on the dynamic secret row. In this modal, you are able to see the expiration time or delete a secret preemptively. ![Provision Lease](../../../images/platform/dynamic-secrets/lease-data.png)