Amazon RDS ERROR 1040 (08004): Too many connections

On an Amazon RDS Aurora data base, when i connect, i get error

This error is due to max_connections setting in MySQL exceeded. By default Amazon RDS set max_connections based on size of RDS instance using following formula.

To see current value, run

To change default value, you need to create a “Parameter group” under Amazon RDS > Parameter groups

On next page, select “Parameter group family” based on what ever RDS version you are using. In this cause i use Amazon Aurora database, so i select “aurora5.6”

Group name and Description, use any value you like, it is just for identification purpose only.

Once created, it will list all available parameter groups. click on newly created parameter group, on next page, it show all options. In the top search box, type in “max_connections” to find the settings. Edit and save.

Now we need to associate this newly created parameter group with Amazon RDS instance, for this go to Amazon RDS > Instances

Select the instance you need to edit, then from “Instance Actions” drop down menu, select modify.

On next page page, you have the option to select “DB parameter group”, select the newly created parameter group.

On next page, you have option to apply change immediately or apply during maintenance window.

You need to reboot the instance to apply the changes.