Forgetting the MySQL login password under Linux system will teach you to change it in two simple steps

Big data learning monk 2022-02-13 07:18:25 阅读数:637

forgetting mysql login password linux

Linux Forget... Under the system MySQL What about the login password ?

Carelessly, you suddenly forget the on the server one day mysql What about the user password ?

First , You have to have an operating system root Yes . If it's connected to the system root Without authority , I suggest you find a way
Think about it first root user , Take the following steps .

/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &

&, Means running in the background , No longer running in the background , Just open another terminal .

mysql> use mysql;
mysql> UPDATE user SET password=password(" Password to change ") WHERE user='root';
mysql> flush privileges;
mysql> exit;
mysql> quit

The proper change is over , You'd better record the password !

copyright:author[Big data learning monk],Please bring the original link to reprint, thank you.