今天启动mysql的时候,遇到mysql不在服务中, 这就让我很尴尬。昨天还用Navicat 插入数据来着。
然后又碰到 Access denied for user 'root'@'localhost' (using password:YES);
首先关闭myslq服务,或者杀掉mysql进程
1.cmd 切换到 mysql bin目录下,
2.执行mysqld --defaults-file="xxx\xxx\my.ini" --console -skip-grant-tables;
3.新开一个dos 执行mysql -uroot mysql
4.执行 select user,password,host from mysql.user;
5.执行 update mysql.user set password=passrod('新密码') where user='root' and host='%';