Ravindra BagaleCourses & study guides मराठी Track your progress

Ravi Sir's Cyber Security Cards › Revision Cards

Connecting from EC2 and Creating the Application User

Connecting from EC2 and Creating the Application User Connecting to RDS from your EC2 server, then making a separate database user for the app. mysql -h your-db-endpoint -u admin -p Then: CREATE USER 'app' … and GRANT only what the app needs. A connection that hangs means the network is blocking it.

Connecting from EC2 and Creating the Application User Connecting to RDS from your EC2 server, then making a separate database user for the app. mysql -h your-db-endpoint -u admin -p Then: CREATE USER 'app' … and GRANT only what the app needs. A connection that hangs means the network is blocking it.
Connecting from EC2 and Creating the Application User · Download PNG
Read card text

What this card says

What it is

Connecting to RDS from your EC2 server, then making a separate database user for the app.

Example

mysql -h your-db-endpoint -u admin -p

Then: CREATE USER 'app' … and GRANT only what the app needs.

If it hangs

A connection that hangs means the network is blocking it.

Check the db security group allows 3306 from the web server.

Tip

Use TLS for the connection, and do not use the admin user in the app.

ErrorLikely causeFix
Hangs, then Can't connect ... (110)Security group or wrong VPCdb-sg inbound 3306 from web-sg; same VPC
Access denied for userWrong user/password or host partCheck SHOW GRANTS, reset password from RDS Modify
Unknown database 'reelsdb'Initial DB name left emptyCREATE DATABASE reelsdb;
Unknown MySQL server hostTypo in endpointCopy endpoint again from the console

Learn more in the lesson: 15.4 Connecting from EC2 and Creating the Application User

See all Ravi Sir's Cyber Security Cards