change max_allowed_packet (or any arbitrary DB parameter group value) in Amazon RDS from commandline

This task sounds to be quite easy, but because the AWS Management Console does not allow the manipulation of parameter group values, you have to go the way using the API from your commandline (or from wherever you want). This post will explain how to do it in your console using the API tools from amazon.

  • Install sun-java6-bin (if you dont have java installed yet!)
  • Unpack them to /opt/rds-tools
  • Move the file “credential-file-path.template” to credentials.txt. Open the file and copy the two keys from your AWS management console (click on ‘Account’ and then ‘Security Credentials’!)
  • Edit the file ~/.bashrc by adding the following lines at the end:
#amazon rds
export AWS_RDS_HOME=/opt/rds-tools
export AWS_CREDENTIAL_FILE=/opt/rds-tools/credentials.txt

and may be the java paths (obviously, you have to adjust the path to the correct version):

export JAVA_HOME=/usr/lib/jvm/java-6-sun-
export PATH=$PATH:/usr/lib/jvm/java-6-sun-
  • Now run whatever command you want:
rds-modify-db-parameter-group custom_paramter_group --parameters "name=max_allowed_packet, value=16777216, method=immediate" --region eu-west-1

Leave a comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.