Skip to content

Instantly share code, notes, and snippets.

@acdha
Last active March 22, 2016 06:15
Show Gist options
  • Save acdha/1084682 to your computer and use it in GitHub Desktop.
Save acdha/1084682 to your computer and use it in GitHub Desktop.
Commands needed to create an AWS RDS database parameter group which defaults to Unicode sanity: UTF-8, full collation, etc.
# Mac Homebrew command to install the RDS command-line tools
# Ubuntu users may find https://launchpad.net/~awstools-dev/+archive/awstools/ useful
brew install rds-command-line-tools
rds-create-db-parameter-group mysql-utf8 -f mysql5.1 -d "MySQL 5.1 configured for UTF-8"
rds-modify-db-parameter-group mysql-utf8 \
--parameters="name=character_set_server, value=utf8, method=immediate" \
--parameters="name=character_set_client, value=utf8, method=immediate" \
--parameters="name=character_set_results, value=utf8, method=immediate" \
--parameters="name=collation_server, value=utf8_unicode_ci, method=immediate" \
--parameters="name=collation_connection, value=utf8_unicode_ci, method=immediate"
# For an existing instance:
rds-modify-db-instance YOUR_DB_NAME --db-parameter-group-name mysql-utf8
rds-reboot-db-instance YOUR_DB_NAME
# To create a new one: note the use of the multi-AZ option
rds-create-db-instance --auto-minor-version-upgrade y \
--db-instance-class db.m1.small \
--db-name YOUR_DB_NAME \
--engine mysql \
--db-parameter-group-name mysql-utf8 \
--multi-az true \
--master-user-password - \
--port 3306 \
-r, --backup-retention-period 1 \
-s, --allocated-storage 5 \
--master-username DESIRED_ROOT_USERNAME \
--engine-version 5.1.63
DBPARAMETER Parameter Name Parameter Value Source Data Type Apply Type Is Modifiable Minimum Version
DBPARAMETER back_log 300 user integer static true
DBPARAMETER character_set_client utf8 user string dynamic true
DBPARAMETER character_set_connection utf8 user string dynamic true
DBPARAMETER character_set_database utf8 user string dynamic true
DBPARAMETER character_set_filesystem utf8 user string dynamic true
DBPARAMETER character_set_results utf8 user string dynamic true
DBPARAMETER character_set_server utf8 user string dynamic true
DBPARAMETER collation_connection utf8_unicode_ci user string dynamic true
DBPARAMETER collation_server utf8_unicode_ci user string dynamic true
DBPARAMETER log_queries_not_using_indexes 1 user boolean dynamic true
DBPARAMETER long_query_time 1 user float dynamic true
DBPARAMETER max_connections 500 user integer dynamic true
DBPARAMETER min_examined_row_limit 100 user integer dynamic true
DBPARAMETER query_cache_limit 2097152 user integer dynamic true
DBPARAMETER query_cache_size 67108864 user integer dynamic true
DBPARAMETER slow_query_log 1 user boolean dynamic true
# aws rds describe-db-parameters --db-parameter-group-name wdl-mysql5-6 --output text | cut -f1 7 8 9 | csvgrep --tabs -c4 -m user
PARAMETERS allow-suspicious-udfs engine-default
PARAMETERS character_set_client utf8mb4 user
PARAMETERS character_set_connection utf8mb4 user
PARAMETERS character_set_database utf8mb4 user
PARAMETERS character_set_filesystem utf8mb4 user
PARAMETERS character_set_results utf8mb4 user
PARAMETERS character_set_server utf8mb4 user
PARAMETERS collation_connection utf8mb4_unicode_ci user
PARAMETERS collation_server utf8mb4_unicode_ci user
PARAMETERS log_queries_not_using_indexes 1 user
PARAMETERS long_query_time 3 user
PARAMETERS query_cache_limit 2097152 user
PARAMETERS query_cache_size 67108864 user
PARAMETERS slow_query_log 1 user
@eikeon
Copy link

eikeon commented Jul 15, 2011

Did it get too long to be an incantation? ;)

@acdha
Copy link
Author

acdha commented Jul 15, 2011 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment