1打开mysql.exe和mysqld.exe所在的文件夹,复制路径地址

输入命令  mysqld --skip-grant-tables  回车,此时就跳过了mysql的用户验证。注意输入此命令之后命令行就无法操作了,此时可以再打开一个新的命令行。注意:在输入此命令之前先在任务管理器中结束mysqld.exe进程,确保mysql服务器端已结束运行。

输入mysql登陆

 C:\Users\Administrator>mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5. MySQL Community Server (GPL)
Copyright (c) , , Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
 mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| itcastoa0720 |
| kingoa |
| mysql |
| performance_schema |
| qin |
| student |
| test |
+--------------------+
rows in set (0.01 sec) mysql> use mysql
Database changed
mysql> show tables;
+---------------------------+
| Tables_in_mysql |
+---------------------------+
| columns_priv |
| db |
| event |
| func |
| general_log |
| help_category |
| help_keyword |
| help_relation |
| help_topic |
| host |
| ndb_binlog_index |
| plugin |
| proc |
| procs_priv |
| proxies_priv |
| servers |
| slow_log |
| tables_priv |
| time_zone |
| time_zone_leap_second |
| time_zone_name |
| time_zone_transition |
| time_zone_transition_type |
| user |
+---------------------------+
rows in set (0.01 sec) mysql> select user,host,password from user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+------+-----------+-------------------------------------------+
row in set (0.00 sec) mysql> update user set password=password('') where user='root' and host='l
ocalhost';
Query OK, row affected (0.00 sec)
Rows matched: Changed: Warnings: mysql> select user,host,password from user;
+------+-----------+-------------------------------------------+
| user | host | password |
+------+-----------+-------------------------------------------+
| root | localhost | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
+------+-----------+-------------------------------------------+
row in set (0.00 sec) mysql>

重新打开一个cmd命令窗口,测试

 C:\Users\Administrator>mysql -u root -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5. MySQL Community Server (GPL) Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>

MySQL忘记密码怎么重置的更多相关文章

  1. windows主机mysql忘记密码如何重置

    本文主要是针对mysql重置密码过程中出现“mysqld不是内部命令或外部命令”的问题而写的.网上有很多关于mysql忘记密码了如何找回的文章,但是很多说的都不够详细,特别是还要用到DOS命令,可能这 ...

  2. windows环境下mysql忘记密码如何重置

    本文主要是针对mysql重置密码过程中出现“mysqld不是内部命令或外部命令”的问题而写的.网上有很多关于mysql忘记密码了如何找回的文章,但是很多说的都不够详细,特别是还要用到DOS命令,可能这 ...

  3. mysql忘记密码如何重置密码,以及修改root密码的三种方法

    1.先将MySQL停止. 命令:systemctl  stop mysqld       #停掉MySQL 命令:systemctl status mysqld         #查看状态 2.然后跳 ...

  4. mysql忘记密码的重置方法

    1. 编辑mysql主配置文件 my.cnfvim /etc/my.cnf在[mysqld]字段下的位置添加参数skip-grant保存退出2. 重启数据库服务service mysqld resta ...

  5. MySQL忘记密码后重置密码(Mac )

    安装好MySQL以后,系统给了个默认的的密码,然后说如果忘记了默认的密码......我复制了默认密码就走过了这一步,这一步就是我漫长旅程的开始.他给的密码太复杂了,当然我得换一个,而且我还要假装我不记 ...

  6. MySQL忘记密码如何重置

    一]进入服务器下,我用的是centos版本 vim /etc/my.cnf 1 vim[二]找到mysqld的部分然后在下面添加上一句代码,意思是跳过密码直接进入,然后保存退出 skip-grant- ...

  7. 【MySQL】MySQL忘记密码或修改密码的方法

    MySQL修改新密码方法 记得原密码情况下,修改新密码:登录到数据库后,输入 set password for 用户名@localhost = '新密码';  来设置新的密码,别忘记分号哦.如图所示: ...

  8. MySQL之从忘记密码到重置密码

    在对MySQL的应用中,难免会有忘记登陆密码的情况:接下来,将简单介绍下MySQL忘记密码如何登陆和重置密码的操作过程. 首先来说下新版MySQL(5.7+)的重置密码过程: 由于忘记登陆密码,所以正 ...

  9. MySQL忘记密码怎么修改密码

    MySQL的 root 帐号密码默认为空,经常都有修改密码后忘记密码的事.如果忘记了root 帐号密码,那该怎么修改密码呢?这里有一个可行的方法,就是在MySQL安全模式下(跳过权限检查)修改密码的方 ...

随机推荐

  1. jquery_lazyload插件

    延迟加载图片的 jQuery 插件 http://www.neoease.com/lazy-load-jquery-plugin-delay-load-image/

  2. 腾讯bugly 映射用法

    package com.tencent.bugly.agent; import android.app.Activity; import android.content.Context; import ...

  3. GitHub教程(三) 本地仓库托管到GitHub

    本文开头先特别声明一下:由于GitHub教程属于Git系列教程的GitHub子篇章,因此GitHub教程中将不再详细介绍Git操作命令及其用法,我会根据实际需要穿插着回顾Git操作命令.如果读者需要学 ...

  4. AOP术语分析

    初看这么多术语,一下子都不好接受,慢慢来,很快就会搞懂. 通知.增强处理(Advice) 就是你想要的功能,也就是上说的安全.事物.日子等.你给先定义好,然后再想用的地方用一下.包含Aspect的一段 ...

  5. CMAKE 安装

    下载 解压  https://cmake.org/download/ https://cmake.org/files/v3.7/cmake-3.7.1.tar.gz yum install gcc - ...

  6. Ubuntu 如何将桌面上的Home中的文件夹除去

    安装Ubuntu后, 由于无法用Terminal(终端)进入带中文的文件夹,会引起很多操作不便.很多朋友想到了将它们都改成中文,但是当再次开机重启使却会发现,原本光洁的桌面现在竟然出现了一堆文件夹?? ...

  7. 504. Inverted Index (Map Reduce) lintcode

    https://www.lintcode.com/problem/inverted-index-map-reduce/description -- decription of the map redu ...

  8. 816 Ambiguous Coordinates (many cases problem)

    https://www.cnblogs.com/Java3y/p/8846955.html -- link of the problem 816 IDEA: check the dot and int ...

  9. 关于nutz跨服务器上传文件

    关于nutz跨服务器上传文件  发布于 578天前  作者 yong9664  770 次浏览  复制  上一个帖子  下一个帖子  标签: 无 是这样的,项目在一台服务器,文件要存储到另外一台服务器 ...

  10. #WPF的3D开发技术基础梳理

    原文:#WPF的3D开发技术基础梳理 自学WPF已经有半年有余了,一遍用,一边学.但是一直没有去触摸WPF的3D开发相关技术,因为总觉得在内心是一座大山,觉得自己没有能力去逾越.最近因为一个项目的相关 ...