安装mysql未设置密码或忘记密码

2020-03-10  本文已影响0人  DifferentMan

1.sudo cat /etc/mysql/debian.cnf


2020-03-10 15-02-23屏幕截图.png

2.mysql -u debian-sys-maint -p
复制上一步拿到的密码,输入password
3.修改密码

use mysql;
update mysql.user set authentication_string=password('123123') where user='root' and Host ='localhost';
update user set plugin="mysql_native_password";
flush privileges;
quit;
4.重启mysql
service mysql restart

上一篇下一篇

猜你喜欢

热点阅读