mysql change user password

Modify vi /etc/my.cnf and add skip-grant-tables to log in to mysql without password

use mysql ;

update user set authentication_string=PASSWORD("123456") where user='root';

Modify vi /etc/my.cnf again, comment skip-grant-tables, restart mysql

mysql -uroot -p123456 login

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324810983&siteId=291194637