pymysql.err.OperationalError while running site

pymysql.err.OperationalError

OperationalError: (2003, “Can’t connect to MySQL server on u’localhost’ ([Errno 111] Connection refused)”)
Traceback (most recent call last)

File "/home/cpu057/erpnext/apps/frappe/frappe/middlewares.py", line 15, in __call__

return super(StaticDataMiddleware, self).__call__(environ, start_response)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/werkzeug/middleware/shared_data.py", line 227, in __call__

return self.app(environ, start_response)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/werkzeug/middleware/shared_data.py", line 227, in __call__

return self.app(environ, start_response)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/werkzeug/local.py", line 231, in application

return ClosingIterator(app(environ, start_response), self.cleanup)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/werkzeug/wrappers/base_request.py", line 235, in application

resp = f(*args[:-2] + (request,))

File "/home/cpu057/erpnext/apps/frappe/frappe/app.py", line 81, in application

response = handle_exception(e)

File "/home/cpu057/erpnext/apps/frappe/frappe/app.py", line 191, in handle_exception

http_status_code=http_status_code)

File "/home/cpu057/erpnext/apps/frappe/frappe/website/render.py", line 33, in render

raise_if_disabled(path)

File "/home/cpu057/erpnext/apps/frappe/frappe/website/render.py", line 345, in raise_if_disabled

'route': ['like', '%{0}'.format(path)]

File "/home/cpu057/erpnext/apps/frappe/frappe/database/database.py", line 527, in get_all

return frappe.get_all(*args, **kwargs)

File "/home/cpu057/erpnext/apps/frappe/frappe/__init__.py", line 1291, in get_all

return get_list(doctype, *args, **kwargs)

File "/home/cpu057/erpnext/apps/frappe/frappe/__init__.py", line 1264, in get_list

return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)

File "/home/cpu057/erpnext/apps/frappe/frappe/model/db_query.py", line 94, in execute

result = self.build_and_run()

File "/home/cpu057/erpnext/apps/frappe/frappe/model/db_query.py", line 108, in build_and_run

args = self.prepare_args()

File "/home/cpu057/erpnext/apps/frappe/frappe/model/db_query.py", line 130, in prepare_args

self.set_optional_columns()

File "/home/cpu057/erpnext/apps/frappe/frappe/model/db_query.py", line 281, in set_optional_columns

columns = frappe.db.get_table_columns(self.doctype)

File "/home/cpu057/erpnext/apps/frappe/frappe/database/database.py", line 848, in get_table_columns

columns = self.get_db_table_columns('tab' + doctype)

File "/home/cpu057/erpnext/apps/frappe/frappe/database/database.py", line 844, in get_db_table_columns

where table_name = %s ''', table)]

File "/home/cpu057/erpnext/apps/frappe/frappe/database/database.py", line 122, in sql

self.connect()

File "/home/cpu057/erpnext/apps/frappe/frappe/database/database.py", line 75, in connect

self._conn = self.get_connection()

File "/home/cpu057/erpnext/apps/frappe/frappe/database/mariadb/database.py", line 90, in get_connection

local_infile = frappe.conf.local_infile)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/pymysql/__init__.py", line 94, in Connect

return Connection(*args, **kwargs)

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/pymysql/connections.py", line 325, in __init__

self.connect()

File "/home/cpu057/erpnext/env/lib/python2.7/site-packages/pymysql/connections.py", line 630, in connect

raise exc

OperationalError: (2003, "Can't connect to MySQL server on u'localhost' ([Errno 111] Connection refused)")

Getting this error while running site,

Thanks in Advance…

Here is a comprehensive post on the topic which should help

Alternatively, maybe it’s just permissions…

1 Like

@trentmu
Thanks for the reply
right-now i installed again MariaDB, if it comes in future "ll chk.