Linux下忘记root密码重置过程笔记
2017-12-20 15:00
417 查看
1.[root@VM_132_65_centos init.d]# service mysql stop
Shutting down MySQL. SUCCESS!
2.[root@VM_132_65_centos init.d]# mysqld_safe --skip-grant-tables
3.另外打开一个窗口
[root@VM_132_65_centos ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.56-log Source distribution
Copyright (c) 2000, 2017, 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> use mysql
Database changed
mysql> update user set password=password("新密码") where user="root";
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@VM_132_65_centos ~]# service mysql restart
Shutting down MySQL. SUCCESS!
用新的密码登录吧!
Shutting down MySQL. SUCCESS!
2.[root@VM_132_65_centos init.d]# mysqld_safe --skip-grant-tables
3.另外打开一个窗口
[root@VM_132_65_centos ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.56-log Source distribution
Copyright (c) 2000, 2017, 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> use mysql
Database changed
mysql> update user set password=password("新密码") where user="root";
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
[root@VM_132_65_centos ~]# service mysql restart
Shutting down MySQL. SUCCESS!
用新的密码登录吧!
相关文章推荐
- linux下mysql-5.6忘记root密码,重置root密码详细过程
- linux下mysql-5.6忘记root密码,重置root密码详细过程
- Centos系统忘记root密码后重置(linux运维笔记)
- 红帽(RHEL)Linux 忘记root密码后重置密码
- Linux 学习笔记1-root密码忘记
- Linux下MySQL5.6.15-忘记root密码-重置
- linux忘记root密码 单用户重置密码
- Linux 自学笔记——忘记 root 用户 和 普通用户 登录密码
- linux下忘记mysql密码,重置root密码
- 忘记root密码通过单用户模式重置过程
- linux忘记root 密码如何重置
- Linux 忘记root密码并重置root密码
- linux 忘记root 密码,如何重置
- Linux系统默认root用户忘记密码重置
- linux(ubuntu为例) 忘记root后的重置密码
- 忘记root密码后如何重置(linux)
- Linux 下mysql忘记root密码,重置密码
- 忘记mysql密码下如何Windows下和Linux下重置了MYSQL的root的密码
- Linux下如果忘记MySQL的root密码,可以通过修改配置的方法,重置root密码
- Linux下MySQL5.6.15-忘记root密码-重置