Change the max_allowed_packet Amazon RDSPosted: February 2, 2012
To change the mysql max_allowed_packet size you appear need to use some tools from Amazon
mv RDSC*/ 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 http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key
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…
mv RDS/ /opt/xxxxxxx
Edit you ~bashrc file and enter the following
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 http://awsdocs.s3.amazonaws.com/RDS/latest/rds-api.pdf or http://docs.amazonwebservices.com/AmazonRDS/latest/CommandLineReference/command-reference.html