Skip to content

Commit 332aae6

Browse files
authored
Merge pull request geerlingguy#140 from geerlingguy/mysql-large-prefix
Fixes geerlingguy#139: Add configuration for innodb_large_prefix.
2 parents 0bdda68 + 8b3af56 commit 332aae6

File tree

7 files changed

+16
-3
lines changed

7 files changed

+16
-3
lines changed

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,10 @@ script:
4444
- 'sudo docker exec --tty "$(cat ${container_id})" env TERM=xterm ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}'
4545

4646
# Test role idempotence.
47+
- idempotence=$(mktemp)
48+
- sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook} | tee -a ${idempotence}
4749
- >
48-
sudo docker exec "$(cat ${container_id})" ansible-playbook /etc/ansible/roles/role_under_test/tests/${playbook}
50+
tail ${idempotence}
4951
| grep -q 'changed=0.*failed=0'
5052
&& (echo 'Idempotence test: pass' && exit 0)
5153
|| (echo 'Idempotence test: fail' && exit 1)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Slow query log settings. Note that the log file will be created by this role, bu
8484
mysql_table_open_cache: "256"
8585
[...]
8686

87-
The rest of the settings in `defaults/main.yml` control MySQL's memory usage. The default values are tuned for a server where MySQL can consume ~512 MB RAM, so you should consider adjusting them to suit your particular server better.
87+
The rest of the settings in `defaults/main.yml` control MySQL's memory usage and some other common settings. The default values are tuned for a server where MySQL can consume ~512 MB RAM, so you should consider adjusting them to suit your particular server better.
8888

8989
mysql_server_id: "1"
9090
mysql_max_binlog_size: "100M"

defaults/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@ mysql_lower_case_table_names: "0"
5151
mysql_wait_timeout: "28800"
5252

5353
# InnoDB settings.
54-
# Set .._buffer_pool_size up to 80% of RAM but beware of setting too high.
5554
mysql_innodb_file_per_table: "1"
55+
# Set .._buffer_pool_size up to 80% of RAM but beware of setting too high.
5656
mysql_innodb_buffer_pool_size: "256M"
5757
# Set .._log_file_size to 25% of buffer pool size.
5858
mysql_innodb_log_file_size: "64M"
5959
mysql_innodb_log_buffer_size: "8M"
6060
mysql_innodb_flush_log_at_trx_commit: "1"
6161
mysql_innodb_lock_wait_timeout: "50"
6262

63+
# These settings require MySQL > 5.5.
64+
mysql_innodb_large_prefix: "1"
65+
mysql_innodb_file_format: "barracuda"
66+
6367
# mysqldump settings.
6468
mysql_mysqldump_max_allowed_packet: "64M"
6569

templates/my.cnf.j2

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ wait_timeout = {{ mysql_wait_timeout }}
8484
lower_case_table_names = {{ mysql_lower_case_table_names }}
8585

8686
# InnoDB settings.
87+
{% if mysql_supports_innodb_large_prefix %}
88+
innodb_large_prefix = {{ mysql_innodb_large_prefix }}
89+
innodb_file_format = {{ mysql_innodb_file_format }}
90+
{% endif %}
8791
innodb_file_per_table = {{ mysql_innodb_file_per_table }}
8892
innodb_buffer_pool_size = {{ mysql_innodb_buffer_pool_size }}
8993
innodb_log_file_size = {{ mysql_innodb_log_file_size }}

vars/Debian.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __mysql_slow_query_log_file: /var/log/mysql/mysql-slow.log
77
mysql_config_file: /etc/mysql/my.cnf
88
mysql_config_include_dir: /etc/mysql/conf.d
99
mysql_socket: /var/run/mysqld/mysqld.sock
10+
mysql_supports_innodb_large_prefix: false

vars/RedHat-6.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ __mysql_slow_query_log_file: /var/log/mysql-slow.log
77
mysql_config_file: /etc/my.cnf
88
mysql_config_include_dir: /etc/my.cnf.d
99
mysql_socket: /var/lib/mysql/mysql.sock
10+
mysql_supports_innodb_large_prefix: false

vars/RedHat-7.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ mysql_pid_file: /var/run/mariadb/mariadb.pid
1313
mysql_config_file: /etc/my.cnf
1414
mysql_config_include_dir: /etc/my.cnf.d
1515
mysql_socket: /var/lib/mysql/mysql.sock
16+
mysql_supports_innodb_large_prefix: false

0 commit comments

Comments
 (0)