Access denied for user 'root'@'localhost' (using password: NO) getting error while installation of frappe-bench

TASK [mariadb : Reload privilege tables] ******************************************************************************************************
task path: /tmp/.bench/playbooks/roles/mariadb/tasks/mysql_secure_installation.yml:21
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c ‘echo ~root && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘( umask 77 && mkdir -p “echo /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522” && echo ansible-tmp-1603877790.828499-264329253930522="echo /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522" ) && sleep 0’
Using module file /usr/local/lib/python3.5/dist-packages/ansible/modules/commands/command.py
<127.0.0.1> PUT /home/frappe/.ansible/tmp/ansible-local-21071glegap7b/tmp84emhaau TO /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522/AnsiballZ_command.py
<127.0.0.1> EXEC /bin/sh -c ‘chmod u+x /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522/ /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘/usr/bin/python3 /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522/AnsiballZ_command.py && sleep 0’
<127.0.0.1> EXEC /bin/sh -c ‘rm -f -r /root/.ansible/tmp/ansible-tmp-1603877790.828499-264329253930522/ > /dev/null 2>&1 && sleep 0’
failed: [localhost] (item=FLUSH PRIVILEGES) => {
“ansible_loop_var”: “item”,
“changed”: false,
“cmd”: [
“mysql”,
“-ne”,
“FLUSH PRIVILEGES”
],
“delta”: “0:00:00.224942”,
“end”: “2020-10-28 15:06:31.237615”,
“invocation”: {
“module_args”: {
“_raw_params”: “mysql -ne “FLUSH PRIVILEGES””,
“_uses_shell”: false,
“argv”: null,
“chdir”: null,
“creates”: null,
“executable”: null,
“removes”: null,
“stdin”: null,
“stdin_add_newline”: true,
“strip_empty_ends”: true,
“warn”: true
}
},
“item”: “FLUSH PRIVILEGES”,
“msg”: “non-zero return code”,
“rc”: 1,
“start”: “2020-10-28 15:06:31.012673”,
“stderr”: “ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)”,
“stderr_lines”: [
“ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)”
],
“stdout”: “”,
“stdout_lines”: []
}

RUNNING HANDLER [mariadb : restart mysql] *****************************************************************************************************
task path: /tmp/.bench/playbooks/roles/mariadb/handlers/main.yml:2

PLAY RECAP ************************************************************************************************************************************
localhost : ok=24 changed=6 unreachable=0 failed=1 skipped=16 rescued=0 ignored=0

Traceback (most recent call last):
File “install.py”, line 472, in
install_bench(args)
File “install.py”, line 264, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 388, in run_playbook
success = subprocess.check_call(args, cwd=playbooks_folder, stdout=log_stream, stderr=sys.stderr)
File “/usr/lib/python3.5/subprocess.py”, line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-vvvv’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

Hi @eliyaskhan18,

Install MariaDB before aply Easy Install Script.

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xF1656F24C74CD1D8
20
sudo add-apt-repository ‘deb [arch=amd64] http://mariadb.mirror.liquidtelecom.com/repo/10.4/debian buster main’
[or]
21
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8 -not work deb 10
22
add-apt-repository ‘deb [arch=amd64] http://ftp.utexas.edu/mariadb/repo/10.5/ubuntu bionic main’ -not work deb 10
23
apt-get update
24
apt-get install mariadb-server
25
systemctl start mariadb
26
systemctl enable mariadb
27
mysql_secure_installation
28
Enter current password for root (enter for none): press enter
29
30
Change the root password? [Y/n]: y
31
New password: yourdbpass
32
Re-enter new password: yourdbpass
33
Password updated successfully!
34
Reloading privilege tables…
35
… Success!
36
37
Remove anonymous users? [Y/n] y
38
Disallow root login remotely? [Y/n] y
39
Remove test database and access to it? [Y/n] y
40
Reload privilege tables now? [Y/n] y
[or]
change mariadb password

sudo /etc/init.d/mysql stop

sudo mysqld_safe --skip-grant-tables &

mysql -uroot

use mysql;

update user set authentication_string=PASSWORD(“admindb”) where User=‘root’;

flush privileges;

quit

sudo /etc/init.d/mysql stop

sudo /etc/init.d/mysql start