Reset root password

We can reset the mysql password using the mysqld_safe parameter with --skip-grant-tables .

  • Can we reset without restarting mysql?
  • Can I reset my password instead of Reset?
+7
source share
4 answers
  • Not
  • Not

And there is a good reason for both answers.

  • You cannot simply prevent any root user from resetting your root password without full administrator level access to the MySQL process on that host.
  • Encrypting MySQL passwords (e.g. Unix) is a one-way street, they can be reset, but they cannot be decrypted.
+6
source

1) You can update the user table in the mysql database, but only if you still have an active connection with sufficient privileges.

2) You cannot, passwords are not saved, only their hash values, your password hash username is compared with the hash stored in mysql, and there is no way to find the password from the hash, except for trying all possible passwords in the hope of a hash match.

+1
source
  • stop the mysql service and start it in safe mode.
  • run mysqld --skip-grant-tables
  • usually change password

see also [1]: http://www.debian-administration.org/articles/442

+1
source

This is described in the official MySQL documentation here: https://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

I doubt that this will affect any problems, as you can basically fix any resolution or user problem with this method.

-one
source

All Articles