Reset mysql root password on Debian/Ubuntu

888u

Last update at :2024-05-02,Edit by888u

Sometimes people are too lazy to back up and record the MySQL password. Are there such people? It starts to hurt when I need to use it! Here are the simple steps to change the root password of MySQL on Debian:

Shut down the mysql service

service mysql stop

No password is required to start mysql and permission settings

mysqld_safe –skip-grant-tables &

Press [ENTER] again if your input is interrupted

Connect to mysql

mysql -u root mysql

Use root privileges and use the following command to change the new password for the mysql root user. We assume that the new password is NEW_PAVPSWORD. The command is as follows:

UPDATE user SET password=PAVPSWORD(‘NEW_PAVPSWORD’) WHERE user=’root’; FLUSH PRIVILEGES;

Restart the mysql service

service mysql restart

Recommended site search: apply for free space, asp hosting space, Tencent cloud server, domain name information, registration query network, registration-free virtual host, Hong Kong server hosting, vip domain name, asp hosting space, mainland China domain name registration,

Reset mysql root password on Debian/Ubuntu

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码