MariaDB10 首次修改密码及忘记密码修改

 vim /etc/my.cnf


添加这一行

[mysqld]

skip-grant-tables     

保存

service mysql restart

登陆mysql

mysql

use mysql;

update user set password = password("your password"),authentication_string=password("your password") where user=root;

flush privileges;

quit

再次编辑 /etc/my.cnf , 将skip-grant-tables   删掉,重启mysql

使用新的密码进行登陆。

你可能感兴趣的:(MariaDB10 首次修改密码及忘记密码修改)