Windows下mysql无法启动1067错误 以及 登录报错Access denied for user ‘root’@‘localhost’ (using password:Y

Windows下MysqL无法启动1067错误解决

解决步骤:

1.  找到自己的MysqL安装目录,比如,我的是D:\MysqL\MysqL Server 5.5

2.  打开my.ini文件

3.  找到 #Path to the database root这一行,将 datadir="C:/ProgramData/MysqL/MysqL Server 5.5/Data/"    修改为自己MysqL安装目录下的  datadir="D:/MysqL/MysqL Server 5.5/Data/"

4.  保存后用cmd输入net start MysqL重启服务即可,然后自己试试看能否启动服务。

 

登录报错Access denied for user ‘root’@‘localhost’ (using password:YES) 

解决步骤:

1.关闭MysqL服务

2.找到my.ini文件,大概67行 [MysqLd] 下添加 一行  skip-grant-tables 保存退出

3.重新打开cmd命令行,执行 MysqL;

4.继续执行  use MysqL;

5.update user set password=password('888888') where user='root';(88888为密码  设置自己想要的密码) 直接复制的注意中英文符号....

6.执行 flush privileges;  刷新权限

7.执行exit;退出MysqL

8.关闭命令行重新启动MysqL 

9.在执行MysqL -u root -p 输入刚刚重置的密码,登陆成功!!

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...