Skip to content

Commit 395f9ed

Browse files
authored
Bug corrected when updating mysql root password
Bug corrected when updating mysql root password for localhost root account (5.7.x). ``` failed: [hostname] (item=localhost) => {"ansible_loop_var": "item", "changed": true, "cmd": "mysql -u root -NBe 'ALTER USER \"root\"@\"localhost\" IDENTIFIED WITH mysql_native_password BY \"xxxxx\"; FLUSH PRIVILEGES;'\n", "delta": "0:00:00.013884", "end": "2023-01-09 11:15:43.965674", "item": "localhost", "msg": "non-zero return code", "rc": 1, "start": "2023-01-09 11:15:43.951790", "stderr": "ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"xxxxx\"' at line 1", "stderr_lines": ["ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\"xxxxx\"' at line 1"], "stdout": "", "stdout_lines": []} ```
1 parent 5bb966f commit 395f9ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tasks/secure-installation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
- name: Update MySQL root password for localhost root account (5.7.x).
4343
shell: >
4444
mysql -u root -NBe
45-
'ALTER USER "{{ mysql_root_username }}"@"{{ item }}"
46-
IDENTIFIED WITH mysql_native_password BY "{{ mysql_root_password }}"; FLUSH PRIVILEGES;'
45+
"ALTER USER '{{ mysql_root_username }}'@'{{ item }}'
46+
IDENTIFIED WITH mysql_native_password BY '{{ mysql_root_password }}'; FLUSH PRIVILEGES;"
4747
with_items: "{{ mysql_root_hosts.stdout_lines|default([]) }}"
4848
when: >
4949
((mysql_install_packages | bool) or mysql_root_password_update)

0 commit comments

Comments
 (0)