mysql初始密码忘记
mysql密码忘记
mysql重置密码vim /etc/my.cf[mysqld]skip-grant-tables:wqsystemctl restart mysqld.servicemysql -uroot -p #提示输入密码直接回车update mysql.user set authentication_string=password('123456') where User="root" and Host="localhost";flush privileges;grant all on *.* to 'root'@'localhost' identified by '123456' with grant option;vim /etc/my.cf
# 删除/注释
skip-grant-tables
# 保存退出
:wqsystemctl restart mysqld.servicemysql -uroot -p
# 输入密码
123456