Installation Fail: Access denied for user 'root'@'localhost'

we executed following command.
python install.py --production

but very first time it failed due to some reason, next time execution onwards it is giving us the error pasted.

TASK [Create new site] *********************************************************
fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["bench", "new-site", "site1.local", "--admin-password", "pnt@936936", "--mariadb-root-password", "pnt@936936"], "delta": "0:00:00.830222", "end": "2016-07-25 18:20:01.888821", "failed": true, "rc": 1, "start": "2016-07-25 18:20:01.058599", "stderr": "Traceback (most recent call last):\n  File \"/usr/lib64/python2.7/runpy.py\", line 162, in _run_module_as_main\n    \"__main__\", fname, loader, pkg_name)\n  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code\n    exec code in run_globals\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 79, in <module>\n    main()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/utils/bench_helper.py\", line 16, in main\n    click.Group(commands=commands)(prog_name='bench')\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 716, in __call__\n    return self.main(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 696, in main\n    rv = self.invoke(ctx)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 1060, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 1060, in invoke\n    return _process_result(sub_ctx.command.invoke(sub_ctx))\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 889, in invoke\n    return ctx.invoke(self.callback, **ctx.params)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/click/core.py\", line 534, in invoke\n    return callback(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 29, in new_site\n    verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/commands/site.py\", line 56, in _new_site\n    admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 33, in install_db\n    create_database_and_user(force, verbose)\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/installer.py\", line 53, in create_database_and_user\n    if force or (db_name not in dbman.get_database_list()):\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/db_schema.py\", line 526, in get_database_list\n    return [d[0] for d in self.db.sql(\"SHOW DATABASES\")]\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 106, in sql\n    self.connect()\n  File \"/home/frappe/frappe-bench/apps/frappe/frappe/database.py\", line 52, in connect\n    use_unicode=True, charset='utf8')\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/__init__.py\", line 81, in Connect\n    return Connection(*args, **kwargs)\n  File \"/home/frappe/frappe-bench/env/lib/python2.7/site-packages/MySQLdb/connections.py\", line 193, in __init__\n    super(Connection, self).__init__(*args, **kwargs2)\n_mysql_exceptions.OperationalError: (1045, \"Access denied for user 'root'@'localhost' (using password: YES)\")", "stdout": "", "stdout_lines": [], "warnings": []}

NO MORE HOSTS LEFT *************************************************************
 to retry, use: --limit @production/install.retry

PLAY RECAP *********************************************************************
localhost                  : ok=36   changed=6    unreachable=0    failed=1   

Traceback (most recent call last):
  File "install.py", line 264, in <module>
    install_bench(args)
  File "install.py", line 99, in install_bench
    run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars)
  File "install.py", line 217, in run_playbook
    success = subprocess.check_call(args, cwd=os.path.join(tmp_bench_repo, 'playbooks'))
  File "/usr/lib64/python2.7/subprocess.py", line 542, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ansible-playbook', '-c', 'local', 'production/install.yml', '-e', '@/tmp/extra_vars.json', '--become', '--become-user=frappe']' returned non-zero exit status 2

Your mysql password is wrong

Hi Rishabh,
While executing the install script it asked for My SQL and Admin Password, So as we understood script will do Maria installation then how does password goes wrong… So do we have to Re-config user / password some where ? We show in forum many people are facing same issue…

VIP

1 Like

Look at thia post of mine [SOLVED] Fresh install error - Access denied for user 'root'@'localhost' - #6 by iadr3805

The install instructions isn’t clear and it’s very time consuming while a simple explanation could help a lot.

Guys Finally I am able to close this issue… dont try on Centos…its not working… Ubuntu V-14 its working fine…

Thanx

Hi Vipul Patel,

How you solved the issue in a Ubuntu 14 installation?

Thanks,

Aníbal.