Mysql忘记root密码
来自三线的随记
Windows系统
结束/关闭mysql服务端
跳过权限表认证
mysqld --skip-grant-tables
开启新的CMD
use mysql;
update user set password = password("xxx") where user = "root";
flush pivileges;
linux系统
/etc/my.cnf
mysqld块
skip-grant-tables
附
plugin字段
--plugin-dir=/usr/lib64/mysql/plugin
auth_socket [ubuntu是auth_socket,unix_socket不知道在什么情况下用]
unix_socket
mysql_native_password