Detailed instructions for Amazon RDS database setup and configuration:
First log on to your Amazon cloud with AWS account. Assuming you have AWS account.
Step 1: Launch new Instance
- After Login Select RDS from top left corner.
- Select Launch a DB Instance.
- Select the MySQL engine or any other engine that you need for your site.DB Instance class: db.t1.micro
- Allocate Storage: 10 GB
- DB Instance Id: xxxx
- Master Username: xxxx (need this when you will try to connect to this database from outside or from your site config file)
- Master password: xxxx (need this when you will try to connect to this database from outside or from your site config file)
- Click continue
- Database Name: xxxx (need this when you will try to connect to this database from outside or from your site config file)
- Database Port: 3306 (don’t change this it’s important to connect the database from external).
- DB Security Groups: List of DB Security Groups associated with this DB Instance. Set it todefault (We use this to add the CIDR/IP that can connect to the database. This is done on different tab.
- Launch the instance. Select the instance and you will see following:
Step 2: Important Setting for .php or config file that we need to connect to RDS DB
We need following settings in Settings.php file or any config file of web site so it can connect to the RDS database.
- Endpoint: The DNS address of the DB Instance.
- Master Username: Name of master user for your DB Instance.
- Master Password
- DB Name: The definition of the term Database Name depends on the database engine in use. For the MySQL database engine, the Database Name is the name of a database hosted in your Amazon DB Instance.
Step 3: Security Group setup
Here we add the CIPR/IP addresses from where we want to connect to the RDS DB instance.
IMP: For Amazon EC2 instance to connect to the RDS DB instance, the DB security group of your Amazon RDS instance refers to the Private IP address of your Amazon EC2 instance. You can get the Private IP address from your EC2 instance details.
- Select the DB Security Group from left menu.
- Select the default group from list.
- Default security group has IP address of my machine. I can connect to the RDS DB instance using the EndPoint, MasterUserName and MasterPassword.
- Default security group has Private IP address of Amazon EC2 instance that we created above to host the Coveros site so that the web site code can talk to the RDS DB instance.