Skip to content

Commit 007487b

Browse files
committed
fix accidental overwrite
1 parent 6e538a8 commit 007487b

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

src/content/docs/hyperdrive/examples/connect-to-postgres/aws-rds-aurora.mdx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ For regular RDS instances (non-Aurora), you will need to fetch the endpoint and
5252
2. Select the database you want Hyperdrive to connect to.
5353
3. Under the **Connectivity & security** header, note down the **Endpoint** and the **Port**.
5454

55-
The endpoint will resemble `YOUR_DATABASE_NAME.cpuo5rlli58m.AWS_REGION.rds.amazonaws.com` and the port will default to `3306`.
55+
The endpoint will resemble `YOUR_DATABASE_NAME.cpuo5rlli58m.AWS_REGION.rds.amazonaws.com` and the port will default to `5432`.
5656

5757
## 2. Create your user
5858

@@ -62,30 +62,31 @@ To create a new user, log in to the database and use the `CREATE ROLE` command:
6262

6363
```sh
6464
# Log in to the database
65-
mysql -h ENDPOINT_NAME -P PORT -u MASTER_USERNAME -p
65+
psql postgresql://MASTER_USERNAME:MASTER_PASSWORD@ENDPOINT_NAME:PORT/database_name
6666
```
6767

6868
Run the following SQL statements:
6969

7070
```sql
71+
-- Create a role for Hyperdrive
72+
CREATE ROLE hyperdrive;
7173

72-
-- Create a database for your application
73-
CREATE DATABASE your_database_name;
74+
-- Allow Hyperdrive to connect
75+
GRANT CONNECT ON DATABASE postgres TO hyperdrive;
7476

75-
-- Create a specific user for Hyperdrive to log in as
76-
CREATE USER 'hyperdrive_user'@'%' IDENTIFIED BY 'sufficientlyRandomPassword';
77+
-- Grant database privileges to the hyperdrive role
78+
GRANT ALL PRIVILEGES ON DATABASE postgres to hyperdrive;
7779

78-
-- Grant database privileges to the hyperdrive user
79-
-- Adjust privileges as needed for your use case
80-
GRANT ALL PRIVILEGES ON your_database_name.* TO 'hyperdrive_user'@'%';
80+
-- Create a specific user for Hyperdrive to log in as
81+
CREATE ROLE hyperdrive_user LOGIN PASSWORD 'sufficientlyRandomPassword';
8182

82-
-- Apply the privileges
83-
FLUSH PRIVILEGES;
83+
-- Grant this new user the hyperdrive role privileges
84+
GRANT hyperdrive to hyperdrive_user;
8485
```
8586

8687
Refer to AWS' [documentation on user roles in PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Roles.html) for more details.
8788

88-
With a database user, password, database endpoint (hostname and port) and database name (default: `mysql`), you can now set up Hyperdrive.
89+
With a database user, password, database endpoint (hostname and port) and database name (default: `postgres`), you can now set up Hyperdrive.
8990

9091
## 3. Create a database configuration
9192

0 commit comments

Comments
 (0)