在/etc/mysql/debian.cnf里找到一个user和password使用该账户登录
mysql -udebian-sys-maint -p
登录后
>use mysql;
>update user set authentication_string=password('新密码'),plugin='mysql_native_password' where user='root';
重启mysql后生效
在/etc/mysql/debian.cnf里找到一个user和password使用该账户登录
mysql -udebian-sys-maint -p
登录后
>use mysql;
>update user set authentication_string=password('新密码'),plugin='mysql_native_password' where user='root';
重启mysql后生效