windows下mysql忘记root密码
2017-07-26 15:54
267 查看
1、首先将mysqld服务停掉
2、在命令行中,cd 到MySQL的bin目录下,然后执行如下命令
mysqld --skip-grant-tables
此时命令行会停止不动,然后你另起一个命令行
3、在新的命令行中输入:mysql
就可以进入mysql了,然后在在mysql的命令行中输入修改root密码的命令;如下
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
>exit
4、然后在重启mysql服务就可以了
不过这中间也可能有别的错误,如:
InnoDB: Operating system error number 5 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. It may also be you have created
a subdirectory InnoDB: of the same name as a data file. InnoDB: File name .\ibdata1 InnoDB: File operation call: ‘open’. InnoDB: Cannot continue operation.
可能的原因是:1、在移动那个\ibdata1文件时,将该文件损坏(将该文件修复一下)
2、给该问件加上了只读权限(去掉他的只读权限)
2、在命令行中,cd 到MySQL的bin目录下,然后执行如下命令
mysqld --skip-grant-tables
此时命令行会停止不动,然后你另起一个命令行
3、在新的命令行中输入:mysql
就可以进入mysql了,然后在在mysql的命令行中输入修改root密码的命令;如下
>use mysql
>update user set password=password("new_pass") where user="root";
>flush privileges;
>exit
4、然后在重启mysql服务就可以了
不过这中间也可能有别的错误,如:
InnoDB: Operating system error number 5 in a file operation. InnoDB: The error means mysqld does not have the access rights to InnoDB: the directory. It may also be you have created
a subdirectory InnoDB: of the same name as a data file. InnoDB: File name .\ibdata1 InnoDB: File operation call: ‘open’. InnoDB: Cannot continue operation.
可能的原因是:1、在移动那个\ibdata1文件时,将该文件损坏(将该文件修复一下)
2、给该问件加上了只读权限(去掉他的只读权限)
相关文章推荐
- windows下mysql忘记root密码的解决办法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- Windows下mysql忘记root密码解决方法
- MySql错误1045 Access denied for user 'root'@'localhost' (using password:YES) windows下的解决方案(忘记密码)
- mysql忘记root密码怎么办(windows)?
- windows下mysql忘记root密码的解决办法
- 忘记mysql密码下如何Windows下和Linux下重置了MYSQL的root的密码
- Windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- Windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决办法
- windows环境中mysql忘记root密码的解决办法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法
- windows下mysql忘记root密码的解决方法