> ## Documentation Index
> Fetch the complete documentation index at: https://risingwavelabs-wyx-add-timestamp-dedicated-page.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CREATE SECRET

> Use the `CREATE SECRET` command to create secrets to store sensitive credentials securely.

<Tip>
  **PREMIUM EDITION FEATURE**

  Secret management is a Premium Edition feature. All Premium Edition features are available out of the box without additional cost on RisingWave Cloud. For self-hosted deployments, users need to purchase a license key to access this feature. To purchase a license key, please contact sales team at [sales@risingwave-labs.com](mailto:sales@risingwave-labs.com).

  For a full list of Premium Edition features, see [RisingWave Premium Edition](/get-started/rw-premium-edition-intro).
</Tip>

## Syntax

```sql theme={null}
CREATE SECRET secret_name WITH ( backend = 'meta') AS 'your_secret';
```

## Parameters

| Parameter or Clause | Description                                                                                           |
| :------------------ | :---------------------------------------------------------------------------------------------------- |
| *secret\_name*      | The name of the secret to be created. This should be a unique identifier within the system.           |
| *backend*           | Specifies the backend where the secret will be stored. Currently, only the meta backend is supported. |
| *your\_secret*      | The secret value that you wish to store securely.                                                     |

## Examples

Here is an example. We create a secret named `mysql_pwd`, and then use it in the `WITH` clause. After that, we use the `SHOW CREATE SOURCE` command to view the password. As shown in the result, the MySQL password is hidden, ensuring no secret leaks.

```sql theme={null}
CREATE SECRET mysql_pwd WITH ( backend = 'meta' ) AS '123';
```

```sql theme={null}
CREATE SOURCE mysql_source WITH (
 connector = 'mysql-cdc',
 hostname = 'localhost',
 port = '8306',
 username = 'rwcdc',
 password = secret mysql_pwd,
 database.name = 'test',
 server.id = '5601'
);
```

```sql theme={null}
SHOW CREATE SOURCE mysql_source;

---RESULT
--- public.mysql_mydb | CREATE SOURCE mysql_mydb WITH (connector = 'mysql-cdc', hostname = 'mysql', port = '3306', username = 'root', password = secret mysql_pwd, database.name = 'mydb', server.id = '2') FORMAT PLAIN ENCODE JSON
```

## See also

<CardGroup>
  <Card title="Manage secrets" icon="key" icontype="solid" href="/operate/manage-secrets">
    A comprehensive guide for secret management operations
  </Card>

  <Card title="DROP SECRET" icon="trash" iconType="solid" href="/sql/commands/sql-drop-secret">
    Dropping a secret
  </Card>
</CardGroup>
