Guide: Manual Install ERPNext on Ubuntu 17.xx & 18.xx

done perfectly, thank you so much

thank you :slight_smile:

when i run a command i got following errors:-

bench@root1-VirtualBox:~$ sudo pip install -e bench-repo
[sudo] password for bench:
Sorry, try again.
[sudo] password for bench:
Sorry, try again.
[sudo] password for bench:
sudo: 3 incorrect password attempts

You need to supply the login password for the user named “bench”.

You need to supply the login password for the user named “bench”.**
how can i do this?

You need an administrator to change it. login as root

passwd bench

Some extra tips are here

how to remove erpnext and bench?

Dear Sir,

Can you assist me for how can i remove erpnext and bench.
And also assist me for further installation.

Just in case, anyone has an error:
wkhtmltopdf: error while loading shared libraries: libfontconfig.so.1: cannot open shared object file: No such file or directory

You need to install

sudo apt-get install libfontconfig1

Try: (Change PASSWORD )

sudo bash -c ‘for i in update {,dist-}upgrade auto{remove,clean}; do apt-get $i -y; done’

sudo apt-get install python-minimal -y

wget https://raw.githubusercontent.com/frappe/bench/master/playbooks/install.py

sudo python install.py --production --user frappe --bench-branch master --frappe-branch staging --erpnext-branch staging --mysql-root-password PASSWORD --admin-password PASSWORD

Hey, I don’t see your guide mention libpq-dev and python-pil packages to be installed. Running bench init halted each time because each of them weren’t present on my Debian unstable system:

$ bench init frappe
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
INFO:bench.utils:env/bin/pip -q install wheel
INFO:bench.utils:env/bin/pip -q install six
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (52/52), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 160689 (delta 11), reused 16 (delta 3), pack-reused 160637
Receiving objects: 100% (160689/160689), 178.98 MiB | 1.28 MiB/s, done.
Resolving deltas: 100% (122269/122269), done.
Checking out files: 100% (2291/2291), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe/env/bin/pip install -q  -e frappe/apps/frappe 
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-VfXOHW/psycopg2/                                                                                  
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bench/commands/make.py", line 30, in init
    python               = python)
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 75, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 135, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 179, in install_app
    find_links=find_links))
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe/env/bin/pip install -q  -e frappe/apps/frappe

After installing libpq-dev the psycopg2 issue was resolved, but another cropped up:

$  bench init frappe
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
INFO:bench.utils:env/bin/pip -q install wheel
INFO:bench.utils:env/bin/pip -q install six
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone https://github.com/frappe/frappe.git   --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 52, done.
remote: Counting objects: 100% (52/52), done.
remote: Compressing objects: 100% (49/49), done.
remote: Total 160689 (delta 11), reused 16 (delta 3), pack-reused 160637
Receiving objects: 100% (160689/160689), 178.98 MiB | 1.21 MiB/s, done.
Resolving deltas: 100% (122269/122269), done.
Checking out files: 100% (2291/2291), done.
('installing', u'frappe')
INFO:bench.app:installing frappe
INFO:bench.utils:frappe/env/bin/pip install -q  -e frappe/apps/frappe 
  Failed building wheel for Pillow
  Failed building wheel for lxml
Command "/home/frappe/frappe/env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-AneHUg/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-qQ63Y3/install-record.txt --single-version-externally-managed --compile --install-headers /home/frappe/frappe/env/include/site/python2.7/Pillow" failed with error code 1 in /tmp/pip-install-AneHUg/Pillow/                                      
Traceback (most recent call last):
  File "/usr/local/bin/bench", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/dist-packages/bench/cli.py", line 40, in cli
    bench_command()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/bench/commands/make.py", line 30, in init
    python               = python)
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 75, in init
    get_app(frappe_path, branch=frappe_branch, bench_path=path, build_asset_files=False, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 135, in get_app
    install_app(app=app_name, bench_path=bench_path, verbose=verbose)
  File "/usr/local/lib/python2.7/dist-packages/bench/app.py", line 179, in install_app
    find_links=find_links))
  File "/usr/local/lib/python2.7/dist-packages/bench/utils.py", line 159, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: frappe/env/bin/pip install -q  -e frappe/apps/frappe

I’m still stuck with this.

Of note is that I’m working on debootsrap’d system. Perhaps these packages are common on a regularly set up system?

if I am not mistaken those commands would need options like --frappe-branch master / --branch master if you not want to end up in a system pulled from the develop branches of frappe/erpnext.

Generally I would always add those options for installation how-to’s even if you specify the default develop branch because it makes it cristal clear what you are getting.

1 Like

Blockquote]Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/decorators.py”, line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/init.py”, line 25, in _func
ret = f(frappe._dict(ctx.obj), *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 169, in install_app
_install_app(app, verbose=context.verbose)
File “/opt/bench/erpnext/apps/frappe/frappe/installer.py”, line 85, in install_app
sync_for(name, force=True, sync_everything=True, verbose=verbose, reset_permissions=True)
File “/opt/bench/erpnext/apps/frappe/frappe/model/sync.py”, line 56, in sync_for
reset_permissions=reset_permissions, for_sync=True)
File “/opt/bench/erpnext/apps/frappe/frappe/modules/import_file.py”, line 65, in import_file_by_path
ignore_version=ignore_version, reset_permissions=reset_permissions)
File “/opt/bench/erpnext/apps/frappe/frappe/modules/import_file.py”, line 133, in import_doc
doc.insert()
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 248, in insert
self.run_post_save_methods()
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 915, in run_post_save_methods
self.run_method(“on_update”)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 780, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1058, in composer
return composed(self, method, *args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 1041, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/opt/bench/erpnext/apps/frappe/frappe/model/document.py”, line 774, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 276, in on_update
self.run_module_method(“on_doctype_update”)
File “/opt/bench/erpnext/apps/frappe/frappe/core/doctype/doctype/doctype.py”, line 343, in run_module_method
module = load_doctype_module(self.name, self.module)
File “/opt/bench/erpnext/apps/frappe/frappe/modules/utils.py”, line 186, in load_doctype_module
raise ImportError(‘Module import failed for {0} ({1})’.format(doctype, module_name + ’ Error: ’ + str(e)))
ImportError: Module import failed for Delivery Trip (erpnext.stock.doctype.delivery_trip.delivery_trip Error: No module named google_maps.google_maps)

Iḿ getting this error while installing ERPNEXT app onto my site. Any idea what causes this?
I’m installing this on Ubuntu 18.04 Desktop

I was able to resolve it by reinstalling the bench and use sudo bench production setup erpnext command. But after installing app on the my site bench --site mysite install-app erpnext , there are no modules appear after I log in.

We are trying to install on ubuntu 18.04 LTS, below error appears every time. How to resolve ?

bench init erpnext && cd erpnext
INFO:bench.utils:virtualenv -q env -p /usr/bin/python
Already using interpreter /usr/bin/python
INFO:bench.utils:env/bin/pip -q install --upgrade pip
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install wheel
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install six
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.utils:env/bin/pip -q install -e git+https://github.com/frappe/python-pdfkit.git#egg=pdfkit
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
INFO:bench.app:getting app frappe
INFO:bench.utils:git clone GitHub - frappe/frappe: Low code web framework for real world applications, in Python and Javascript --origin upstream
Cloning into ‘frappe’…
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 162770 (delta 6), reused 5 (delta 2), pack-reused 162743
Receiving objects: 100% (162770/162770), 191.86 MiB | 279.00 KiB/s, done.
Resolving deltas: 100% (123849/123849), done.
(‘installing’, u’frappe’)
INFO:bench.app:installing frappe
INFO:bench.utils:erpnext/env/bin/pip install -q -e erpnext/apps/frappe
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for Python 2.7.
Updating node packages…
INFO:bench.utils:yarn install
yarn install v1.13.0
[1/4] Resolving packages…
[2/4] Fetching packages…
[3/4] Linking dependencies…
warning “rollup-plugin-vue > @vue/component-compiler@3.4.4” has unmet peer dependency “postcss@>=6.0”.
[4/4] Building fresh packages…
[1/3] ⢀ uws
[2/3] ⢀ cypress
error /opt/bench/erpnext/apps/frappe/node_modules/cypress: Command failed.
Exit code: 1
Command: node index.js --exec install
Arguments:
Directory: /opt/bench/erpnext/apps/frappe/node_modules/cypress
Output:
Installing Cypress (version: 3.1.1)

[08:32:48] Downloading Cypress [started]
[08:32:51] Downloading Cypress 0% 0s [title changed]
[08:32:51] Downloading Cypress 0% 0s [title changed]
[08:32:51] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 0% 0s [title changed]
[08:32:52] Downloading Cypress 1% 116s [title changed]
[08:32:52] Downloading Cypress 1% 127s [title changed]
[08:32:53] Downloading Cypress 1% 138s [title changed]
[08:35:49] Downloaded Cypress [title changed]
[08:35:49] Downloaded Cypress [completed]
[08:35:49] Unzipping Cypress [started]
[08:35:49] Unzipping Cypress [failed]
[08:35:49] → The Cypress App could not be unzipped.

Search for an existing issue or open a GitHub issue at

Issues · cypress-io/cypress · GitHub

Error: end of central directory record signature not found

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.1.1
The Cypress App could not be unzipped.

Search for an existing issue or open a GitHub issue at

Issues · cypress-io/cypress · GitHub

Error: end of central directory record signature not found

Platform: linux (Ubuntu Linux - 18.04)
Cypress Version: 3.1.1

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 11, in
load_entry_point(‘bench’, ‘console_scripts’, ‘bench’)()
File “/opt/bench/bench-repo/bench/cli.py”, line 40, in cli
bench_command()
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python2.7/dist-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/bench-repo/bench/commands/make.py”, line 30, in init
python = python)
File “/opt/bench/bench-repo/bench/utils.py”, line 83, in init
update_node_packages(bench_path=path)
File “/opt/bench/bench-repo/bench/utils.py”, line 449, in update_node_packages
update_yarn_packages(bench_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 462, in update_yarn_packages
exec_cmd(‘yarn install’, cwd=app_path)
File “/opt/bench/bench-repo/bench/utils.py”, line 159, in exec_cmd
raise CommandFailedError(cmd)
bench.utils.CommandFailedError: yarn install

Helloo all,

I am trying to install erpnext on ubuntu 18.04.01.

Is that possible to fix the below error?

`TASK [bench : Install ERPNext to default site] *************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {“changed”: true, “cmd”: [“bench”, “–site”, “site1.local”, “install-app”, “erpnext”], “delta”: “0:00:02.213109”, “end”: “2019-02-08 12:11:45.903268”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2019-02-08 12:11:43.690159”, “stderr”: “”, “stderr_lines”: [], “stdout”: “site1.local does not exist”, “stdout_lines”: [“site1.local does not exist”]}
to retry, use: --limit @/tmp/.bench/playbooks/site.retry

PLAY RECAP *************************************************************************************************************************************************************************************************
localhost : ok=80 changed=32 unreachable=0 failed=1

Traceback (most recent call last):
File “install.py”, line 426, in
install_bench(args)
File “install.py”, line 123, in install_bench
run_playbook(‘site.yml’, sudo=True, extra_vars=extra_vars)
File “install.py”, line 339, in run_playbook
success = subprocess.check_call(args, cwd=os.path.join(cwd, ‘playbooks’))
File “/usr/lib/python2.7/subprocess.py”, line 190, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘ansible-playbook’, ‘-c’, ‘local’, ‘site.yml’, ‘-e’, ‘@/tmp/extra_vars.json’, ‘–become’, ‘–become-user=frappe’]’ returned non-zero exit status 2

I’m following the steps to install on Ubuntu server 18.04 LTS.

After executing the line:

bench new-site site1.local

I get the following error. I’ve entered the same MariaDB password, but still no use. Please help me out here. I’m stuck for the past 2 days at this step.

bench@ubuntu-server:/opt/bench/erpnext$ bench new-site site1.local
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 174, in _run_module_as_main
main”, fname, loader, pkg_name)
File “/usr/lib/python2.7/runpy.py”, line 72, in _run_code
exec code in run_globals
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/opt/bench/erpnext/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 33, in new_site
db_type = db_type)
File “/opt/bench/erpnext/apps/frappe/frappe/commands/site.py”, line 66, in _new_site
source_sql=source_sql,force=force, reinstall=reinstall, db_type=db_type)
File “/opt/bench/erpnext/apps/frappe/frappe/installer.py”, line 35, in install_db
setup_database(force, source_sql, verbose)
File “/opt/bench/erpnext/apps/frappe/frappe/database/init.py”, line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)
File “/opt/bench/erpnext/apps/frappe/frappe/database/mariadb/setup_db.py”, line 39, in setup_database
if force or (db_name not in dbman.get_database_list()):
File “/opt/bench/erpnext/apps/frappe/frappe/database/db_manager.py”, line 58, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/opt/bench/erpnext/apps/frappe/frappe/database/database.py”, line 121, in sql
self.connect()
File “/opt/bench/erpnext/apps/frappe/frappe/database/database.py”, line 74, in connect
self._conn = self.get_connection()
File “/opt/bench/erpnext/apps/frappe/frappe/database/mariadb/database.py”, line 88, in get_connection
local_infile = frappe.conf.local_infile)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 325, in init
self.connect()
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 599, in connect
self._request_authentication()
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 861, in _request_authentication
auth_packet = self._read_packet()
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/opt/bench/erpnext/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1698, u"Access denied for user ‘root’@‘localhost’")

mysql -uroot -pYourMYSQLpassword -Bse "GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'YourMYSQLpassword' WITH GRANT OPTION;"

Also, IF you get the below version of the error…

#ERROR 1045 (28000): Access denied for user '8de49ae55a02e7ac'@'localhost' (using password: YES)
DBname=$(cat ~/frappe-bench/sites/site1.local/site_config.json | awk '/db_name/ {print $2}' | sed "s/\"//g" | sed "s/,//g")
DBpass=$(cat ~/frappe-bench/sites/site1.local/site_config.json | awk '/db_password/ {print $2}' | sed "s/\"//g")
#
mysql -uroot -pYourMYSQLpassword -Bse "GRANT ALL PRIVILEGES ON *.* TO '$DBname'@'localhost' IDENTIFIED BY '$DBpass' WITH GRANT OPTION;"
mysql -uroot -pYourMYSQLpassword -Bse "GRANT ALL PRIVILEGES ON *.* TO '$DBname'@'127.0.0.1' IDENTIFIED BY '$DBpass' WITH GRANT OPTION;"
#
mysql -uroot -pYourMYSQLpassword -Bse "set password for '$DBname'@'localhost' = password('$DBpass');"
mysql -uroot -pYourMYSQLpassword -Bse "set password for '$DBname'@'127.0.0.1' = password('$DBpass');"
#delete the DB and re-run
bench new-site site1.local
1 Like

In my system, site_config.json file is located at /opt/bench/erpnext/sites/site1.local

I’ve directly went into this directory and executed the command for DBname and DBpass. Sill the mysql commands is throwing the following error:

mysql -uroot -proot -Bse “set password for ‘$DBname’@‘localhost’ = password(‘$DBpass’);”
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’

I’m still unable to run the bench command to setup new-site.

Please help.

You also need the current password for the mysql DB which you created when you installed/secured it.