Try ERPNext Buy Support Partners Foundation

Not able to add a site

on running this command bench new-site site1.local, getting an error
MySQL root password:
Traceback (most recent call last):
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/pymysql/connections.py”, line 583, in connect
**kwargs)
File “/usr/lib/python3.6/socket.py”, line 724, in create_connection
raise err
File “/usr/lib/python3.6/socket.py”, line 713, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3.6/runpy.py”, line 193, in _run_module_as_main
main”, mod_spec)
File “/usr/lib/python3.6/runpy.py”, line 85, in _run_code
exec(code, run_globals)
File “/home/ishita/frappe-bench2/apps/frappe/frappe/utils/bench_helper.py”, line 97, in
main()
File “/home/ishita/frappe-bench2/apps/frappe/frappe/utils/bench_helper.py”, line 18, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 764, in call
return self.main(*args, **kwargs)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/click/core.py”, line 555, in invoke
return callback(*args, **kwargs)
File “/home/ishita/frappe-bench2/apps/frappe/frappe/commands/site.py”, line 34, in new_site
db_type=db_type, db_host=db_host, db_port=db_port)
File “/home/ishita/frappe-bench2/apps/frappe/frappe/commands/site.py”, line 71, in _new_site
source_sql=source_sql, force=force, reinstall=reinstall, db_type=db_type, db_host=db_host, db_port=db_port)
File “/home/ishita/frappe-bench2/apps/frappe/frappe/installer.py”, line 35, in install_db
setup_database(force, source_sql, verbose)
File “/home/ishita/frappe-bench2/apps/frappe/frappe/database/init.py”, line 16, in setup_database
return frappe.database.mariadb.setup_db.setup_database(force, source_sql, verbose)
File “/home/ishita/frappe-bench2/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 “/home/ishita/frappe-bench2/apps/frappe/frappe/database/db_manager.py”, line 61, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/ishita/frappe-bench2/apps/frappe/frappe/database/database.py”, line 122, in sql
self.connect()
File “/home/ishita/frappe-bench2/apps/frappe/frappe/database/database.py”, line 75, in connect
self._conn = self.get_connection()
File “/home/ishita/frappe-bench2/apps/frappe/frappe/database/mariadb/database.py”, line 90, in get_connection
local_infile = frappe.conf.local_infile)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/pymysql/init.py”, line 94, in Connect
return Connection(*args, **kwargs)
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/pymysql/connections.py”, line 325, in init
self.connect()
File “/home/ishita/frappe-bench2/env/lib/python3.6/site-packages/pymysql/connections.py”, line 630, in connect
raise exc
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘localhost’ ([Errno 111] Connection refused)”)

Looks like MySQL server is down. Run below to restart:
sudo service mysql restart

thereafter, create site.

Job for mariadb.service failed because a timeout was exceeded.
gives this error on restarting

Check out below:

still showing the same error even after restart