vim /etc/my.cnf
添加此行
skip-grant-table
systemctl restart mariadb
mysql
select user,password,host from mysql.user;
update mysql.user set password=password(“123456”) where user=“root” and host=“localhost”;
flush privileges;
\q
vim /etc/my.cnf
注释添加的那行
systemctl restart mariadb
登录成功。
如何解决mysql数据库忘记密码
最新推荐文章于 2025-02-17 10:52:42 发布