1. 下载 后解压
2. 使用管理员身份运行cmd, 进入到mysql解压目录, 执行初始化和运行命令:
-
安装
mysqld.exe --remove => mysqld.exe --initialize => mysqld.exe install -
启动重置
启动: net start mysql => mysql -uroot -p => 输入密码,密码在data目录.err文件
重置: alter user user() identified by "root" => alter user '123456' identified by 'root'
3. 错误收集
- 不以管理员身份运行, 提示
Install/Remove of the Service Denied!
- 重置密码命令
mysqladmin -u root password root
失败
mysqladmin: connect to server at 'localhost' failed,
error: 'Access denied for user 'root'@'localhost' (using password: NO)
- 未添加用户失败
mysql> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
- 密码为重置失败
mysql> alter user 'root' identified by 'root';
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
-
未执行初始化无法启动
网友评论