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!)
- Download the API Client tools for RDS
- 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:
1 2 3 4 |
#amazon rds export AWS_RDS_HOME=/opt/rds-tools export PATH=$PATH:$AWS_RDS_HOME/bin 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):
1 2 |
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.20 export PATH=$PATH:/usr/lib/jvm/java-6-sun-1.6.0.20/bin |
- Now run whatever command you want:
1 |
rds-modify-db-parameter-group custom_paramter_group --parameters "name=max_allowed_packet, value=16777216, method=immediate" --region eu-west-1 |