Last active
March 22, 2016 06:15
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Heh, I'll stop before it becomes a liturgy.
Chris
…On Friday, July 15, 2011 at 10:10 AM, eikeon wrote:
Did it get too long to be an incantation? ;)
##
Reply to this email directly or view it on GitHub:
https://gist.github.com/1084682
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did it get too long to be an incantation? ;)