Skip to content

Commit 4e37c5f

Browse files
committed
Allow sql_mode to be overridden
This Sitepoint tutorial explains our exact reasoning for needing to override this setting: https://www.sitepoint.com/quick-tip-how-to-permanently-change-sql-mode-i n-mysql/
1 parent 2c8c807 commit 4e37c5f

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ mysql_port: "3306"
3131
mysql_bind_address: '0.0.0.0'
3232
mysql_skip_name_resolve: no
3333
mysql_datadir: /var/lib/mysql
34+
mysql_sql_mode: ''
3435
# The following variables have a default value depending on operating system.
3536
# mysql_pid_file: /var/run/mysqld/mysqld.pid
3637
# mysql_socket: /var/lib/mysql/mysql.sock

templates/my.cnf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ pid-file = {{ mysql_pid_file }}
1212
{% if mysql_skip_name_resolve %}
1313
skip-name-resolve
1414
{% endif %}
15+
{% if mysql_sql_mode %}
16+
sql_mode = {{ mysql_sql_mode }}
17+
{% endif %}
1518

1619
# Logging configuration.
1720
{% if mysql_log_error == 'syslog' or mysql_log == 'syslog' %}

0 commit comments

Comments
 (0)