CyberPanel Community

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

ri
ricardofh #1

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?

9 replies
us
usmannasir #2

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

nt
nttung #3

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

us
usmannasir #4

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

I am sorry?

tr
trifo13 #5

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.

ri
ricardofh #6

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

Cy
CyberPanel #7

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

systemctl restart gunicorn.socket
ri
ricardofh #8
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?

ri
ricardofh #10
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

Sign in to reply