困扰我三天的问题 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

  1. 首先将C:\Program Files\MySQL\MySQL Server 8.0\data删除
  2. 在bin目录下使用管理员cmd mysqld -remove
  3. mysqld --initialize --console 找到 A temporary password is generated for root@localhost: 后面的密码,
  4. mysqld -install
  5. 然后启动数据库,输入密码
  6. ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘修改的密码’;
    解压版mysql 错误-mysql启动失败

你可能感兴趣的:(mysql实践45讲)