CyberPanel down after changing Mysql password

Hi all, I am hoping someone can help me. My CyberPanel is down with a 500 internal error. I was trying to fix a database backup issue with mysqldump due to having changed the MariaDB/Mysql root password. I changed the passwords in the below files to match the correct ones. I have since reset the password again on Mysql and rebooted and restarted the CyberPanel service to no avail. I don’t know what else to try. I am also confused about a few things, does CyberPanel just take the password from the files below or is there a way to reset the CyberPanel database password? Sorry if I am explaining this wrong, I am only weeks in from managing my own VPS, having always used shared hosting. Also, I assume when I see Mysql in these files, does it really mean MariaDB? Or does the system have both MariaDB and Mysql?

Also, I did just do some updates right before I messed with the passwords. So there is a small chance that is adding to or the cause of my issue.

The files I edited.

/home/cyberpanel/.my.cnf

/usr/local/CyberCP/CyberCP/settings.py

/etc/cyberpanel/mysqlPassword

/etc/mysql/my.cnf

You need to change the cyberpanel database password from mysql command. Just editing the files alone wont do. Its same for root database password too where you need to change it from mysql command and then edit all these files with new password.

to change cyberpanel password, use this:

mysql -u root -p

Login to mysql root using the root password

once logged in, you can use this command to change cyberpanel password

ALTER USER 'cyberpanel'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';

The output will show something like this

Query OK, 0 rows affected (0.00 sec)

Hi, Thanks for your reply!! I have been at this for hours. I did the command you gave and it didn’t work. Does that command change both of these? If not, how do I reset the other one?
Sample:
‘default’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘cyberpanel’,
‘USER’: ‘cyberpanel’,
‘PASSWORD’: ‘cyberpanel’,
‘HOST’: ‘localhost’,
‘PORT’:’’
},
‘rootdb’: {
‘ENGINE’: ‘django.db.backends.mysql’,
‘NAME’: ‘mysql’,
‘USER’: ‘root’,
‘PASSWORD’: ‘cyberpanel’,
‘HOST’: ‘localhost’,
‘PORT’: ‘’,
}
}

login to root mysql

mysql -u root -p

Then change root password (change NEW_USER_PASSWORD to the password you want to set)

ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';

then change cyberpanel database password using the same method (change NEW_USER_PASSWORD to the password you want to set)

ALTER USER 'cyberpanel'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';

The changed passwords needs to be mentioned/edited in these files:

/home/cyberpanel/.my.cnf
/usr/local/CyberCP/CyberCP/settings.py
/etc/cyberpanel/mysqlPassword
/etc/mysql/my.cnf

I re-entered all of them and did the commands. It is still down. My etc/mysql/my.cnf did not have a password in there. I added it and it did not help.

Take a backup of your current state of server and then provide me login details of the server if possible over private message so that I take a look and check the cause of the issue and fix it.

I will have to figure out how to back it up tomorrow and I will message you. Thanks for your help! Alternatively, is there a way to remove CyberPanel?

There is no removal method for Cyberpanel and Operating System both.

You will have to reset the VPS.

Where are the log files stored?

Just in case, if you forget to reboot vps after changing the password, please do reboot the server for the changes to take effect and see if it works.

I did restart it yesterday. I figured it out! I must have deleted the last } under the databases in setting.py by accident. She’s up and running! Thank you for your help to fix the passwords.

1 Like

Glad to know everything is working fine now.