Problem restarting droplet after root password change


So I’ve recently inherited a site built by another developer; it’s a Wordpress site built on CENTOS8 with a ‘non managed’ MySQL.

I couldn’t initially get root access as we’re no longer in touch with the original dev, so I needed to do a root password reset and create my own SSH pairing. This all went as expected until I tried to access the site on the front end…

Initially the site was returning a 521 error… Then I remembered that droplets are shut down during a reset.

I actually struggled at first getting it to reboot with the ‘normal’ service restart commands (‘service not loaded’ errors), but eventually found that ‘httpd restart’ seemed to do the trick… Then! When I access the site from the front end, the wordpress ‘can’t connect to database’ screen appeared.

Do I need to restart the MySQL server as well using a different command? I’ve tried the usual suspects, but there doesn’t seem to be access to the MySQL through usual sockets… If this is the case, how do you restart a CENTOS8 MySQL?

If I’m completely wrong and there’s a best practice for restarting your services after a root password reset, please feel free to point me in the right direction.

Thanks and all the best

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’ve now solved this… So, just for posterity, if anyone is having the same issue, and like me, does not have access to the dev who set the server up, here’s how it was done.

Power down droplet

Go through the reset root password dialogue

Register new password through terminal

check which services are running (sudo netstat -plt)

Make sure your HTTP HTTPS and MySQL are returning values. If all or some are missing, reboot HTTP by ‘sudo service httpd restart’

…And then the bit which caught me out; there’s a good chance, especially if you’re running CENTOS 8, that you’re running MariaDB and not MySQL servers, so sure, first try sudo systemctl start mysql, or sudo systemctl start mysqld… Failing that, give sudo systemctl start mariadb a go.