ubuntu 首次登录mysql 未设置密码或忘记密码 解决方法
sudo cat /etc/mysql/debian.cnf mysql -u debian-sys-maint -p //注意:后面需要输入的密码是上一个命令看的文件password后的值 use mysql; // 下面这句命令有点长,请注意。 update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost'; update user set plugin="mysql_native_password"; flush privileges; quit; 重新启动mysql

浙公网安备 33010602011771号