Unable to start site

when i try to install new site i am getting an error after entering mysql password.

dev@webos-develop:~/meeting/frappe-bench$ bench new-site meeting.dev
MySQL root password:
Traceback (most recent call last):
File “/usr/lib/python2.7/runpy.py”, line 162, 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 “/home/dev/meeting/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 79, in
main()
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/utils/bench_helper.py”, line 16, in main
click.Group(commands=commands)(prog_name=‘bench’)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 722, in call
return self.main(*args, **kwargs)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 697, in main
rv = self.invoke(ctx)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/click/core.py”, line 535, in invoke
return callback(*args, **kwargs)
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/commands/site.py”, line 26, in new_site
verbose=verbose, install_apps=install_app, source_sql=source_sql, force=force)
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/commands/site.py”, line 57, in _new_site
admin_password=admin_password, verbose=verbose, source_sql=source_sql,force=force, reinstall=reinstall)
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/installer.py”, line 35, in install_db
create_database_and_user(force, verbose)
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/installer.py”, line 54, in create_database_and_user
if force or (db_name not in dbman.get_database_list()):
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/model/db_schema.py”, line 542, in get_database_list
return [d[0] for d in self.db.sql(“SHOW DATABASES”)]
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/database.py”, line 107, in sql
self.connect()
File “/home/dev/meeting/frappe-bench/apps/frappe/frappe/database.py”, line 53, in connect
use_unicode=True, charset=‘utf8mb4’)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/init.py”, line 81, in Connect
return Connection(*args, **kwargs)
File “/home/dev/meeting/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py”, line 193, in init
super(Connection, self).init(*args, **kwargs2)
_mysql_exceptions.OperationalError: (2002, ‘Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2 “No such file or directory”)’)

Hi, @vivin_joseph

please check your sql is not work properly.

Thanks

type this line to start sql
/etc/init.d/mysql start

1 Like

@MaysaaSafadi i tried this but i am getting an error

[…] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details.
failed!

run sudo journalctl -xe
and see the error log in it

Mar 09 17:57:59 webos-develop sudo[31846]: pam_unix(sudo:session): session opene
Mar 09 17:58:08 webos-develop com.ubuntu.OneConf[4634]: WARNING:oneconf.hosts:Er
Mar 09 17:58:18 webos-develop sudo[31846]: pam_unix(sudo:session): session close
Mar 09 18:03:44 webos-develop sudo[32069]: dev : TTY=pts/23 ; PWD=/home ; U
Mar 09 18:03:44 webos-develop sudo[32069]: pam_unix(sudo:session): session opene
Mar 09 18:03:49 webos-develop systemd[1]: Reloading.
Mar 09 18:03:49 webos-develop systemd[1]: Started CUPS Scheduler.
– Subject: Unit cups.service has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit cups.service has finished starting up.

– The start-up result is done.
Mar 09 18:03:49 webos-develop systemd[1]: Stopped MySQL Community Server.
– Subject: Unit mysql.service has finished shutting down
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit mysql.service has finished shutting down.
Mar 09 18:03:50 webos-develop sudo[32069]: pam_unix(sudo:session): session close
Mar 09 18:07:12 webos-develop sudo[32203]: dev : TTY=pts/23 ; PWD=/home ; U
Mar 09 18:07:12 webos-develop sudo[32203]: pam_unix(sudo:session): session opene
lines 1782-1804/1804 (END)
Mar 09 17:57:59 webos-develop sudo[31846]: pam_unix(sudo:session): session opene
Mar 09 17:58:08 webos-develop com.ubuntu.OneConf[4634]: WARNING:oneconf.hosts:Er
Mar 09 17:58:18 webos-develop sudo[31846]: pam_unix(sudo:session): session close
Mar 09 18:03:44 webos-develop sudo[32069]: dev : TTY=pts/23 ; PWD=/home ; U
Mar 09 18:03:44 webos-develop sudo[32069]: pam_unix(sudo:session): session opene
Mar 09 18:03:49 webos-develop systemd[1]: Reloading.
Mar 09 18:03:49 webos-develop systemd[1]: Started CUPS Scheduler.
– Subject: Unit cups.service has finished start-up
– Defined-By: systemd
– Support: (http://)lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit cups.service has finished starting up.

– The start-up result is done.
Mar 09 18:03:49 webos-develop systemd[1]: Stopped MySQL Community Server.
– Subject: Unit mysql.service has finished shutting down
– Defined-By: systemd
– Support: (https://)lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit mysql.service has finished shutting down.
Mar 09 18:03:50 webos-develop sudo[32069]: pam_unix(sudo:session): session close
Mar 09 18:07:12 webos-develop sudo[32203]: dev : TTY=pts/23 ; PWD=/home ; U
Mar 09 18:07:12 webos-develop sudo[32203]: pam_unix(sudo:session): session opene

I also ran in to the problem while running Ubuntu’s software updater.
Anyway, someone posted a solution to a similar problem over here:

Maybe it can solve your/our problem? :sweat_smile: