1. 程式人生 > >linux上mysql5.7上密碼忘記,解決方案

linux上mysql5.7上密碼忘記,解決方案

mysql5.7 忘記密碼!!!
首先執行 vi /etc/my.cnf,新增skip-grant-tables儲存,

然後重啟服務 service  mysqld  restart,

這時不需密碼,可以直接登陸mysql,通過update語句,修改

update mysql.user set authentication_string=password('MyAegis131423!') where user='root' ;