1、cmd使用管理员权限进去,
输入mysql -u root -p
报下面这个错误
2、安装mysqld服务器,输入命令:mysqld --install
(报Install/Remove of the Service Denied,就需要以管理员进去)
net stop mysql 停止服务
net start mysql 启动服务
3、启动起来之后,输入mysql -u root -p 输入密码发现报错(using password:YES)
则需要输入update mysql.user set authentication_string=password('root') where user='root' ;来修改密码,
如果报错了ERROR 1054 (42S22): Unknown column 'authentication_string' in 'field list'
则要换个语句,使用这个
update mysql.user set password=password('root') where user='root';
4、上面出现OK的话就要再flush privileges;刷新一下,在退出验证一下,可以登录进去。
这样就可以登录成功啦!