sudo vim /etc/mysql/debian.cnf
password = hGu99nJgoWcmCDKT
找到password 后这段长密码
mysql -u debian-sys-maint -p 此长密码
use mysql;
update user set authentication_string=PASSWORD("自定义密码") where user='root';
update user set plugin="mysql_native_password";
flush privileges;
quit;
/etc/init.d/mysql restart;
mysql -u root -p 密码;
OK成功