网站设计项目建设内容,哪个网站可以做社工试题,百度推广登录入口下载,可以在公司局域网做网站吗忘记 MySQL 密码怎么办#xff1a;破解 root 账户密码 目录 忘记 MySQL 密码怎么办#xff1a;破解 root 账户密码1、修改 MySQL 配置文件2、不使用密码登录 MySQL3、重置 root 用户密码4、修改 MySQL 配置文件并重启 MySQL 服务5、使用新密码登录 MySQL 如果忘记密码导致无法…忘记 MySQL 密码怎么办破解 root 账户密码 目录 忘记 MySQL 密码怎么办破解 root 账户密码1、修改 MySQL 配置文件2、不使用密码登录 MySQL3、重置 root 用户密码4、修改 MySQL 配置文件并重启 MySQL 服务5、使用新密码登录 MySQL 如果忘记密码导致无法登录 MySQL 可以采用如下方法使 root 密码失效然后不使用密码登录 MySQL重新设置新密码。步骤如下
1、修改 MySQL 配置文件
在 MySQL 配置文件的 [mysqld] 选项下加入如下代码
[mysqld]
...
skip-grant-tables
...然后重启 MySQL 服务
C:\Users\Administratornet stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。C:\Users\Administratornet start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。2、不使用密码登录 MySQL
C:\Users\Administratormysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.48 MySQL Community Server (GPL)Copyright (c) 2000, 2016, 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.mysql3、重置 root 用户密码
方法一修改 MySQL 数据库中的 user 表
-- 选择 mysql 数据库
mysql use mysql
Database changed-- 更新 user 表
mysql select user,host,password from user;
------------------------------------------------------------
| user | host | password |
------------------------------------------------------------
| root | localhost | *97CFEED34A83BE1C8CA2D879A71A978A9B14568F |
| root | 127.0.0.1 | |
| root | ::1 | |
| | localhost | |
------------------------------------------------------------
4 rows in set (0.01 sec)-- 刷新权限
mysql update user set passwordpassword(123456) where userroot and hostlocalhost;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1 Changed: 1 Warnings: 0mysql flush privileges;
Query OK, 0 rows affected (0.01 sec)方法二使用 set password 命令
-- 格式set password for 用户名localhost password(‘新密码’);
mysql set password for rootlocalhost password(123456);
Query OK, 0 rows affected (0.00 sec)mysql flush privileges;
Query OK, 0 rows affected (0.00 sec)4、修改 MySQL 配置文件并重启 MySQL 服务
1删除 MySQL 配置文件中的如下内容
[mysqld]
...
# skip-grant-tables # 删除此行
...2重启 MySQL 服务
C:\Users\Administratornet stop mysql
MySQL 服务正在停止.
MySQL 服务已成功停止。C:\Users\Administratornet start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。5、使用新密码登录 MySQL
C:\Users\Administratormysql -uroot -p123456
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.48 MySQL Community Server (GPL)Copyright (c) 2000, 2016, 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.