Change the max_allowed_packet Amazon RDS

To change the mysql max_allowed_packet size you appear need to use some tools from Amazon

cd ~

mkdir /software

cd software

wget -c


mv RDSC*/ RDS/

cd RDS

mv credential-file-path.template credentials.txt

We now need to get the credentials for you AWS account, if you are reading this I take it you don’t need to know how to do this, if you do need some help

vi credentials.txt

Enter the ID and key

The system then needs to understand where the files and paths are stored.

I create a new folder under the opt directory called my company name. This then allows me to add now standard programs, menus etc…

mkdir /opt/xxxxxx

cd ~

cd software

mv RDS/ /opt/xxxxxxx

Edit you ~bashrc file and enter the following

export AWS_RDS_HOME=/software/RDS
export AWS_CREDENTIAL_FILE=$AWS_RDS_HOME/credentials.txt

This is basing it on you following the instructions above, amend you path statements based on where you have store the download and credential file.

The Region needs to be replace with the region that you database is stored in

e.g. us-west-1, eu-west-1

NOTE if your database is in eu-west-1b then you need to enter eu-west-1

To find the zone use the RDS module in the AWS-Console, click in the instance and look for the zone and remove the last letter.

Remember you will need to log-off an on for the PATH to take effect an you need JAVA installed on the system.

To see if this is working issue


You can now create a parameter group, this will allow you to associate the relevant parameters, this is the equivilant of creating the my.cnf buy the looks of it.

rds-create-db-parameter-group NAMEOFGROUP -f DATABASEVERSION -d “My custom database parameter group”

NAMEOFGROUP – If this is a single multi used database, give it a generic name otherwise give it the name of the RDS name

DATABASEVERSION – at the time of writing mysql5.1 mysql5.5


rds-create-db-parameter-group mydbgroup -f mysql5.1 -d “My custom database parameter group”

This has now created the shell to store the parameters such as max_allowed_packet

rds-modify-db-parameter-group NAMEOFGROUP –parameters “name=max_allowed_packet,value=20971520,method=immediate” 


rds-modify-db-parameter-group mydbgroup –parameters “name=max_allowed_packet,value=20971520,method=immediate” 

We now need to associate the parameter group with the instance

rds-modify-db-instance your-instance-here –db-parameter-group-name NAMEOFGROUP

Substitute you RDS instance name (your-instance-here and NAMEOFGROUP)

Navigate to the RDS console and highlight the instance and press reboot (MAKE SURE YOU HAVE ONLY ONE INSTANCE HIGHLIGHTED AND THE CORRECT ONE)

The database will reboot and should now have the parameter file associated.

The full documentation can be found here or


4 Comments on “Change the max_allowed_packet Amazon RDS”

  1. […] Change the Query Cache Size Amazon AWS RDS Posted: July 11, 2012 | Author: survivalguides | Filed under: Amazon AWS, IT Survival, RDS |Leave a comment » We are running a PHP web site with the Mysql RDS from Amazon, there is a need to change the PHP cache size to make the server run more effectively. Normally this would be done in the my.cnf file but as you know with RDS you use the parameter groups. If you don’t have the RDS tools on your server then look to the another blogg by me for the instructions on getting it up and running Change the max_allowed_packet Amazon RDS […]

  2. […] You have to use the RDS command line tools, you can see how to install them in my riveting post  Change the max_allowed_packet Amazon RDS […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s