You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
21
21
22
-
To create a Hyperdrive configuration with the [Wrangler CLI](/workers/wrangler/install-and-update/), open your terminal and run the following command. Replace \<NAME_OF_HYPERDRIVE_CONFIG> with a name for your Hyperdrive configuration and paste the connection string provided from your database host, or replace `user`, `password`, `HOSTNAME_OR_IP_ADDRESS`, `port`, and `database_name` placeholders with those specific to your database:
To create a Hyperdrive configuration with the Cloudflare dashboard:
29
27
30
-
Hyperdrive will attempt to connect to your database with the provided credentials to verify they are correct before creating a configuration. If you encounter an error when attempting to connect, refer to Hyperdrive's [troubleshooting documentation](/hyperdrive/observability/troubleshooting/) to debug possible causes.
28
+
<Steps>
29
+
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/login).
30
+
2. Go to **Storage & Databases** > **Hyperdrive**.
31
+
3. Select **Create Configuration**.
32
+
4. Fill out the form, including the connection string.
33
+
5. Select **Create**.
34
+
</Steps>
31
35
32
-
:::
36
+
</TabItem>
37
+
<TabItemlabel="Wrangler CLI">
33
38
34
-
This command outputs a binding for the [Wrangler configuration file](/workers/wrangler/configuration/):
39
+
To create a Hyperdrive configuration with the [Wrangler CLI](/workers/wrangler/install-and-update/):
40
+
<Steps>
41
+
1. Open your terminal and run the following command. Replace `<NAME_OF_HYPERDRIVE_CONFIG>` with a name for your Hyperdrive configuration and paste the connection string provided from your database host, or replace `user`, `password`, `HOSTNAME_OR_IP_ADDRESS`, `port`, and `database_name` placeholders with those specific to your database:
2. This command outputs a binding for the [Wrangler configuration file](/workers/wrangler/configuration/):
43
48
44
-
# Pasted from the output of `wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string=[...]` above.
45
-
[[hyperdrive]]
46
-
binding = "HYPERDRIVE"
47
-
id = "<ID OF THE CREATED HYPERDRIVE CONFIGURATION>"
48
-
```
49
+
<WranglerConfig>
50
+
51
+
```toml
52
+
name = "hyperdrive-example"
53
+
main = "src/index.ts"
54
+
compatibility_date = "2024-08-21"
55
+
compatibility_flags = ["nodejs_compat"]
49
56
50
-
</WranglerConfig>
57
+
# Pasted from the output of `wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string=[...]` above.
58
+
[[hyperdrive]]
59
+
binding = "HYPERDRIVE"
60
+
id = "<ID OF THE CREATED HYPERDRIVE CONFIGURATION>"
61
+
```
62
+
63
+
</WranglerConfig>
64
+
</Steps>
65
+
</TabItem>
66
+
67
+
</Tabs>
68
+
69
+
:::note
70
+
Hyperdrive will attempt to connect to your database with the provided credentials to verify they are correct before creating a configuration. If you encounter an error when attempting to connect, refer to Hyperdrive's [troubleshooting documentation](/hyperdrive/observability/troubleshooting/) to debug possible causes.
0 commit comments