首先在配置文件里查看debian-sys-maint的密码
sudo cat /etc/mysql/debian.cnf
然后使用该用户登录:
mysql -udebian-sys-maint -p
use mysql;
update user set plugin="mysql_native_password";
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
flush privileges;
会提示密码太简单,弄复杂一点就好了。
这篇博客介绍了如何在Debian系统中查看并使用debian-sys-maint用户登录MySQL,然后更新root用户的密码,将认证方式改为mysql_native_password,并解决密码过于简单的提示,以增强数据库安全性。
1644

被折叠的 条评论
为什么被折叠?



