Recover Lost Root Password in mysql

xiaoxiao2021-03-06  38

Recover Lost Root Password in mysql

-----------------------------------

Login as UNIX root

STOP mysqld (/etc/init.d/mysqld stop)

START MySQLD (/ usr / bin / safe_mysqld --skip-grant-table)

Login Into The MySQL Server (MySQL -U Root MySQL)

Change the root password (update user set password = password ('new_password') where user = 'root';)

Flush the privileges for the change to take effect (flush privileges;)

EXIT The Database (QUIT)

Stop The Database (Might Need To Kill The Process)

Restart the database as normal (/etc/init.d/mysqld start)

转载请注明原文地址:https://www.9cbs.com/read-76145.html

New Post(0)