• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

windows上mysql忘记root密码解决办法

mysql 搞代码 7年前 (2018-06-06) 138次浏览 已收录 0个评论

windows下mysql忘记root密码解决方法

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、给该问件加上了只读权限(去掉他的只读权限)


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:windows上mysql忘记root密码解决办法

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址