Bench new-site pymysql.err.OperationalError: (2003, "Can't connect to MySQL server

Hey Team,

I am new to ERPnext and as a part of my learning process in wanted to install ERPnext on my vps server. Configuration of my VPS server is as below:
1 CPU Core
1 GB RAM
20 GB SSD Storage
OS: CentOS7

While trying to “bench new-site erp.something.com”, I am getting this error - pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘127.0.0.1’ ([Errno 111] Connection refused)”)

I have changed the ‘self.host = host or “127.0.0.1”’ ->'self.host = host or “localhost”’ in /opt/bench/erpnext/env/lib/python3.6/site-packages/pymysql/connections.py file but didn’t work. I am getting this error in Python 3.6 and 2.7 both the version.
I have latest version of PIP 20.0.2

@soumyadeeps Is this production or development system? sudo systemctl restart mysqld try this.

1 Like

Thank you @arokia for your response.
Since I am new to erpnext, I really do not know whether the files that I have downloaded or the commands I have executed is of for production or development system because in the installation guide it is not mentioned whether it is for production or development.

The idea at this stage for me is to have a development system setup and that the development server would not be my local system, but it would be deployed on the VPS server for any development activity.
Additionally I also want to have the production setup done on the same server as a separate instance. Kindly let me know if this possible.
Along with it would be great if you can help me out from where i can get the proper installation guide (CentOS7 / Ubuntu 18.04)

Secondly I have restarted mysql service according to your suggestion ( sudo systemctl restart mysqld) but it didn’t work.

Thanks in advance and would be great if you can help me in letting me install the development as well as production setup.

Thanks
Soumyadeep

@soumyadeeps Please find below links for setup guide

https://frappe.io/docs/user/en/deployment

In case of MySQL not Restarting - These are core services in your Ubuntu system restarting should work Please check status of service also

Hi @khushal_t The link do not works. Can you please help me out here as I am too struggling with the installation process.

Thanks in advance.
Prakash

Hi Team,

Anybody can help me out with the installation of erp on my VPS server.

!!! WARNING The following tests failed:

  • [err]: Active defrag in tests/unit/memefficiency.tcl
    defrag didn’t stop.
    Cleanup: may take some time… OK
    Makefile:271: recipe for target ‘test’ failed
    make[1]: * [test] Error 1
    make[1]: Leaving directory ‘/tmp/redis-stable/src’
    Makefile:6: recipe for target ‘test’ failed
    make: * [test] Error 2
    ============================================================================
    !!! WARNING The following tests failed:

  • [err]: pending querybuf: check size of pending_querybuf after set a big value in tests/unit/pendingquerybuf.tcl
    the used_memory of replica is much larger than master. Master:43866016 Replica:85809072

  • [err]: Active defrag in tests/unit/memefficiency.tcl
    defrag didn’t stop.
    Cleanup: may take some time… OK
    Makefile:271: recipe for target ‘test’ failed
    make[1]: * [test] Error 1
    make[1]: Leaving directory ‘/tmp/redis-stable/src’
    Makefile:6: recipe for target ‘test’ failed
    make: * [test] Error 2

I thought I would give a try for ERPnext as a part of my skill development activities but somewhere I see that the is no relevant documents which is reliable enough which can help me enable install the ERP.

@arokia @khushal_t an you please help me in this case please.

Thanks in advance
Prakash

This is not particularly an ERPNext issue. Your MySQL server isn’t set up correctly. Check if it is running and the configuration is set correctly, first. If you’re new at this, I’d recommend you use the Easy Install instead.

I’d recommend against editing Python packages. This could break the behavior of existing system applications and make your environment un-reproducible.