[SOLVED] Unable to connect to database - Clean Install of ERPNext - Ubuntu 14.04.5

Hi everyone,

First I’m new with ERPNext and I tried to install it in a clean Ubuntu Server 14.04.5. But, continuously I got the next error:

TASK [Set root Password for Ubuntu] ******************************************** fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "unable to connect to database, check login_user and login_password are correct or /home/********istrador/.my.cnf has the credentials. Exception message: (1045, \"Access denied for user 'root'@'localhost' (using password: NO)\")"}
to retry, use: --limit @production/install.retry

… and the trace is:

Traceback (most recent call last): File "install.py", line 319, in <module> install_bench(args) File "install.py", line 111, in install_bench run_playbook('production/install.yml', sudo=True, extra_vars=extra_vars) File "install.py", line 269, in run_playbook success = subprocess.check_call(args, cwd=os.path.join(cwd, 'playbooks')) File "/usr/lib/python2.7/subprocess.py", line 540, 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

The MySQL password is fine and correctly passed to the script.

What I’ve tried?

  • Reinstall MariaDB
  • Different Administrator passwords
  • Change MySQL password

The output is always the same.

If anyone could give a hand, I’ll appreciate.



This is the solution that I used after the error below.

sudo apt-get --purge autoremove supervisor nginx mysql* maria*

sudo find / | grep mysql | sudo xargs rm -rf

Before that, I ran the install script again, but when ask for the mysql password I didn’t give one, just press enter. The script later on will reset the password and you must give it the one you choose.

The installation ends without errors, so it’s solved the mysql password connection issue.