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. C++ Knowledge series STL & Const

    Thank to the pepole who devote theirself to the common libs. STL(http://www.cplusplus.com/reference/ ...

  2. Android基础Activity篇——Intent

    1.显式的Intent intent是用来各各活动之间切换的,还可以用来传递参数. 项目还是使用之前创建的ActivityTest项目,这里新建一个活动SecondActivity.java,并且勾选 ...

  3. 浅谈SQL Server中的事务日志(一)----事务日志的物理和逻辑构架

    简介 SQL Server中的事务日志无疑是SQL Server中最重要的部分之一.因为SQL SERVER利用事务日志来确保持久性(Durability)和事务回滚(Rollback).从而还部分确 ...

  4. yum第三方源

    EPEL RHEL 6: http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm RHEL 7: http:// ...

  5. PowerShell 脚本域策略管理

    大中型企业中,会设置许多组策略进行日常运维管理 ,毕然里面也存在许多废弃的策略,需要我们定期清理我们的组策略信息.通常我们导出HTML报告方式来帮助我们分析组策略信息: #1 首先需要加载GroupP ...

  6. Leetcode 46 47 Permutation, 77 combination

    Permutation class Solution { List<List<Integer>> res = new ArrayList<List<Integer& ...

  7. yum 源搭建

    RHEL系统部署网络yum源 配置网络yum源 RHEL系统本身光盘做成的yum源所提供的软件包有限,在实际使用过程中经常会出现缺包的现象,本文中以CentOS源作为替代,CentOS的软件包和RHE ...

  8. jwt 在.net core 2.0的使用

    jwt个人觉得更适合作共享session的传递格式,本身保密性不好,容易泄露重要信息,他的格式为头.一些用户的自定义声明.前两者的加密(公私对称密钥形式) 需要引用nuget: System.Iden ...

  9. 安裝 PHP 時出現undefined reference to `libiconv_open’ 之類的錯誤訊息

    在安裝 PHP 到系統中時要是發生「undefined reference to `libiconv_open'」之類的錯誤訊息,那表示在「./configure 」沒抓好一些環境變數值.錯誤發生點在 ...

  10. HTTP的DELETE方法Body传递参数问题解决

    理论上,Delete method是通过url传递参数的,如果使用body传递参数呢? 前提: 使用HttpClient发送http请求 问题: httpDelete对象木有setEntity方法 解 ...