Changing Root Server Password Breaks Cyberpanel

So I changed my root server password because I forget it and restarted the server - 30 days back. Now I’m just explaining it from my perspective and I might be wrong but this is the order of events.

  1. Changed Password
  2. Backups stop immediately
  3. Exactly 30 days later I lose mysql root access, can’t login to Cyberpanel and websites.
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock
  1. Borked - Reinstall Cyberpanel
  2. Make post on forum to hopefully save someone else this pain

Im not exactly 100 if that’s all connected but what I would suggest to anyone - once it’s setup don’t fiddle or even restart your server. Rather just set it up and forget.

Cyberpanel is actually pretty good though, much better than Plesk in my opinion besides it feeling like it’s held together with duct tape and chewing gum sometimes it’s free and it works very well.

You need change database password for cyberpanel
login to root mysql. Answer by @die2mrw007 copied from another thread

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

do you changed the mysql root pass?
what is the output of
df
also tell this

Thanks Dreamer…

Ill try this in future, if it happens again -
Hopefully this will help someone else in the same situation

I did open settings.py and it showed the passwords, one being the new root password and the other the MySQL but didn’t know all those needed to run those commands USER “root” after you change the password at your host CP. Just didn’t know these procedures were needed in the first place.

The chance of having to change that root password are pretty high.
Besides knowing how to install CyberPanel these are important steps to know.

This is the solution. If at any time you have this problem because you have changed the root password or root@localhost, which causes the phpmyadmin blank screen, does not allow you to create databases in the domains, prevents you from making backups… of everything… this process and it works.
As normally we only change the root password, recovering the cyberpanel@localhost password and putting it back as the root password is enough
Greetings and Merry Christmas to all the good people!