(2003, 'Can\\'t connect to MySQL server on \\'127.0.0.1\\' (111 "Connection refused")')

Request Method: GET
Request URL: https://96.9.244.26:8090/
Django Version: 1.11
Exception Type: OperationalError
Exception Value:

(2003, 'Can\‘t connect to MySQL server on \‘127.0.0.1\’ (111 “Connection refused”)’)

Exception Location: /usr/lib64/python2.7/site-packages/MySQLdb/connections.py in init, line 193
Python Executable: /usr/bin/python
Python Version: 2.7.5
Python Path:

[’/usr/local/CyberCP’,
‘/usr/bin’,
‘/usr/lib/python2.7/site-packages/gunicorn-19.7.1-py2.7.egg’,
‘/usr/lib/python2.7/site-packages/psutil-5.4.3-py2.7-linux-x86_64.egg’,
‘/usr/lib64/python27.zip’,
‘/usr/lib64/python2.7’,
‘/usr/lib64/python2.7/plat-linux2’,
‘/usr/lib64/python2.7/lib-tk’,
‘/usr/lib64/python2.7/lib-old’,
‘/usr/lib64/python2.7/lib-dynload’,
‘/usr/lib64/python2.7/site-packages’,
‘/usr/lib/python2.7/site-packages’]

Server time: Mon, 5 Mar 2018 01:27:33 +0000

HOW DO I FIX THIS?

Looks like you tried to upgrade without backing up your settings file. Submit a support ticket, I will have a look.

Dear !
This error occur when i increase RAM storage, i change to old, the errors dissapear…
what happended ???
Thanks

@nttung said:
Dear !
This error occur when i increase RAM storage, i change to old, the errors dissapear…
what happended ???
Thanks

I am sorry?

Hey guys.

I had the same problem after securing my MySQL ( mysql_secure_installation ) and changing the root password.

How I resolved that, was by manually setting the MySQL root password in: /usr/local/CyberCP/CyberCP/settings.py and restarting.

Best,
Trifo.

Same error again,

Did not try to do anything… did not upgrade anything or changed anything. I tried changing cyberpanel’s mysql password to try to solve this and did not managed to do it

In your settings file for ‘cyberpanel’ database try to replace user with ‘root’ and password with ‘/etc/cyberpanel/mysqlPassword’ then:

systemctl restart gunicorn.socket
In your settings file for 'cyberpanel' database try to replace user with 'root' and password with '/etc/cyberpanel/mysqlPassword' then:
systemctl restart gunicorn.socket

Nope, does not work. It seems like there was a SQL injection due to a attack and it messed up the whole installation, how is that possible?

SQL Injection does not work on DJango: Security in Django | Django documentation | Django

SQL Injection does not work on DJango: https://docs.djangoproject.com/en/2.1/topics/security/#sql-injection-protection

Mananged to fix it, just a reboot