MySQL 8.013重置密码 windows10 环境

参考自:https://blog.csdn.net/baidu_32363401/article/details/81544573?utm_source=blogxgwz1 

https://blog.csdn.net/qq_33337277/article/details/81454700

的方法二。

但版本不同,有些许差异,首先是:

1)由于mysqld –skip-grant-tables实测在mysql8.0中已失效,现使用mysqld --console --skip-grant-tables --shared-memory

修正他的说法:

这里使用的指令是“mysqld –shared-memory –skip-grant-tables”,若是只是“mysqld –skip-grant-tables”的话,会导致mysqld启动失败,提示“TCP/IP, –shared-memory, or –named-pipe should be configured on NT OS”错误。经过测试,只有加上“–shared-memory”才能启动、访问数据库。

注明:指令“mysqld –shared-memory –skip-grant-tables”在8.013失效 ;

2)ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';  

不能写成ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'root';  

猜你喜欢

转载自blog.csdn.net/nsjlive/article/details/83451020