[SOLVED] Fresh install error - Access denied for user 'root'@'localhost'

Hi, My previous thread was closed without a resolution, so opening a new one. Each day when I try fresh install I get a new error. Running CentOs 7. Previous errors are in previous thread, today’s error is below

TASK [Create new site] *********************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “new-site”, “site1.local”, “–admin-password”, “password”, “–mariadb-root-password”, “password”], “delta”: “0:00:00.901970”, “end”: “2016-07-27 08:12:49.122578”, “failed”: true, “rc”: 1, “start”: “2016-07-27 08:12:48.220608”, “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 \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=39 changed=21 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 281, in
install_bench(args)
File “install.py”, line 102, in install_bench
run_playbook(‘production/install.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 234, 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
[user@localhost ~]$

I’m trying to understand why these access errors are happening. So the script install MYSLQ with blank password and then you have to leave password empty when it asks later in the script.

Second time when I did that it’s trying to access with user 1bd3e0294d@localhost. Who is this user and what’s the password and it doesn’t even ask about the password when running the script.

MySQL password error?

Note: Please make descriptive titles.

Yes, I read from the error that it’s MySQL password error. But I hadn’t install MySQL on the server. The script which installs ERPNEXT installs all the prerequisites. During the install it asks for root Password. I’m assuming that will be used to install MYSQL. And you can see my second try it’s a completely different user.

That’s where it’s confusing, I don’t understand the whole script to make changes.

@iadr3805

Try doing mysql -u root

and then

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

1 Like

Steps, I ran
wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py
Then: sudo python install.py --production
The install script will ask for MySQL root password, even though the script installs it doesn’t set the password it’s asking.
After MySQL is install, I set the same password as given above to root and by the time the script comes to access MySQL the password works.

Everything finished and no errors. I still can’t access localhost but assuming some of the services haven’t been started. Which services are used I don’t know but will find out some how.

It would help if these are explained in the install process.

Lastly, SELINUX was blocking nginx service from starting.