Make "MySQL Root Password" auto-repair the root grant
Sometimes, root can't access MySQL because /root/.my.cnf contains a wrong password, or no password. But sometimes it's because the root grant is missing or broken:
- user 'root' might not exist
- grant might be for 'root'@'*' instead of 'root'@'%'
- "super" or "grant" privileges might be missing
It wouldn't be hard, in an automated way, to make sure that the necessary root grants are in place and configured correctly, and it would be extremely helpful to system administrators and support personnel.
More info below. This is not a complete list of grants that have to exist, but it's enough to get started.