使用管理员运行cmd;
转到MySQL的bin目录下
输入mysqld --initialize --console
打开MySql服务:net start MySQL
登录MySQL:mysql -u root -p
修改密码为root:set password for root@localhost = password(‘root’);
最后退出在验证
出现这样的问题是因为密码错误:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
MySql服务未启动:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost:3306' (10061)