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