From f11655f3f968bd313dd2552d74bf9b49c1eaf5cf Mon Sep 17 00:00:00 2001 From: Peter Sirotnak Date: Tue, 20 Jan 2026 09:32:34 +0100 Subject: [PATCH] PMM-7: Fix mysql connection --- .../tasks/prepare_install_ps.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pmm_qa/percona_server_for_mysql/tasks/prepare_install_ps.yml b/pmm_qa/percona_server_for_mysql/tasks/prepare_install_ps.yml index 8e4cc727..3ad0b1e5 100644 --- a/pmm_qa/percona_server_for_mysql/tasks/prepare_install_ps.yml +++ b/pmm_qa/percona_server_for_mysql/tasks/prepare_install_ps.yml @@ -68,11 +68,21 @@ seconds: 5 - name: Chance root password Percona Server for MySQL 5.7 - shell: "docker exec {{ container_prefix }}{{ item }} mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '{{ root_password }}';\"" + shell: > + docker exec {{ container_prefix }}{{ item }} mysql -e " + ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '{{ root_password }}'; + GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED WITH mysql_native_password BY '{{ root_password }}' WITH GRANT OPTION; + FLUSH PRIVILEGES;" loop: "{{ range(1, nodes_count | int + 1) | list }}" when: ps_version|replace('_', '')|int < 80 - name: Chance root password Percona Server for MySQL 8.0+ - shell: "docker exec {{ container_prefix }}{{ item }} mysql -e \"ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '{{ root_password }}';\"" + shell: > + docker exec {{ container_prefix }}{{ item }} mysql -e " + ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY '{{ root_password }}'; + CREATE USER IF NOT EXISTS 'root'@'%' IDENTIFIED WITH caching_sha2_password BY '{{ root_password }}'; + ALTER USER 'root'@'%' IDENTIFIED WITH caching_sha2_password BY '{{ root_password }}'; + GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION; + FLUSH PRIVILEGES;" loop: "{{ range(1, nodes_count | int + 1) | list }}" when: ps_version|replace('_', '')|int >= 80