MySql重启服务步骤

  1. 删除安装目录下 data文件
  2. mysqld --initialize --console  A temporary password:****  是root用户密码
  3. mysqld --install安装mysql服务(mysqld --remove是卸载MySQL服务)
  4. net stop mysql
  5. net start mysql
  6. 进入数据库mysql -u root -p***
  7. 查询报错Access denied  解决方法:ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '***'; 
参考:https://blog.csdn.net/missing2011/article/details/81474857
09-07 19:07