Changed MySQL root pw, Service Status: down (but it isn't)

APatchworkBoy

Active Member
Feb 26, 2018
27
7
3
West Yorkshire, UK
cPanel Access Level
Root Administrator
Morning all - running v74.0.9, I've just reset the MySQL root password via WHM interface.

Service Status now shows mysql is down - it isn't. It's up and running fine.

Code:
Service Name:    mysql
Service Status:    failed ⛔
Notification:    The service “mysql” appears to be down.
Service Check Method:    The system’s command to check or to restart this service failed.
Number of Restart Attempts:    2
Service Check Raw Output:    (XID hxvggd) The service “mysql” failed to start with the message: Access denied for user 'root'@'localhost' (using password: YES)

The subprocess “/usr/local/cpanel/scripts/restartsrv_mysql” reported error number 255 when it ended.

Startup Log:    Starting MySQL. SUCCESS!

Log Messages:    2018-10-25 13:25:46 32183 [Note] /usr/sbin/mysqld: ready for connections.
2018-10-25 13:25:45 31784 [Note] /usr/sbin/mysqld: Shutdown complete
2018-10-25 13:25:44 31784 [Note] /usr/sbin/mysqld: Normal shutdown
2018-10-25 13:25:32 31784 [Note] /usr/sbin/mysqld: ready for connections.
2018-10-25 13:24:02 31131 [Note] /usr/sbin/mysqld: Shutdown complete


'sudo /scripts/restartsrv_mysql' appears to function perfectly when run by hand. No errors reported.

Code:
# sudo /usr/local/cpanel/scripts/restartsrv_mysql

Waiting for “mysql” to restart ……waiting for “mysql” to initialize ………finished.


Service Status

    mysql (/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=fqdn.err --open-files-limit=10000 --pid-file=/var/lib/mysql/fqdn.pid) is running as mysql with PID 812 (pidfile+/proc check method).


Startup Log

    Starting MySQL. SUCCESS! 


Log Messages

    2018-10-25 13:35:09 812 [Note] /usr/sbin/mysqld: ready for connections.

    2018-10-25 13:35:08 32728 [Note] /usr/sbin/mysqld: Shutdown complete

    2018-10-25 13:35:07 32728 [Note] /usr/sbin/mysqld: Normal shutdown

    2018-10-25 13:30:36 32728 [Note] /usr/sbin/mysqld: ready for connections.

    2018-10-25 13:30:35 32183 [Note] /usr/sbin/mysqld: Shutdown complete


mysql restarted successfully.

I spotted:
Problem after mysql root password change

And have followed the advice for resetting root password via CLI using mysql-init txt file to see if that resolves... it doesn't.

Any suggestions to get Service Manager / Status to report correctly?
 
Last edited:

GOT

Get Proactive!
PartnerNOC
Apr 8, 2003
1,542
207
343
Chesapeake, VA
cPanel Access Level
DataCenter Provider
You should go back and change it again via whm because it updates more than just the actual password.

The service manager can lag by as much as 20 minutes. If it's still down after that as indicated (though not actually down) then we can look at other possibilities.
 

APatchworkBoy

Active Member
Feb 26, 2018
27
7
3
West Yorkshire, UK
cPanel Access Level
Root Administrator
Well, had to go work from home cos #reasons... and returned to an email from the server stating:

The system automatically reset the MySQL/MariaDB root password in order to restore normal operations.

The system restored the password to the password in “/root/.my.cnf”.
And indeed it had, so, I then changed the password in /root/.my.cnf to the one I wanted to set at the beginning of this post, THEN returned to WHM and changed the MySQL Root Password there to the same as the one I’d just specified in /root/.my.cnf - this time it’s worked.

You should go back and change it again via whm because it updates more than just the actual password.
When I set it manually via CLI, I specified the same password as the one I’d just set via WHM, so technically all processes should have been followed internally...

Theory: Appears the problem looks simply to have been that when I changed it via WHM the first time round, it didn’t update the passwords in /root/.my.cnf automatically, and that was causing Service Status to fail when checking, as the only difference this time around is that I’ve changed it by hand there first.