mysql忘记密码处理
来源:互联网 发布:数据透视表值显示文本 编辑:程序博客网 时间:2024/05/19 01:09
1、首先停止数据库
在[mysqld]的段中加上一句:skip-grant-tables
[mysqld]
skip-grant-tables
[root@wolf bin]# service mysqld stop
Shutting down MySQL.. [ OK ]
[root@wolf bin]# service mysqld start
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
5、在[mysqld]的段中删除或注释:skip-grant-tables
[mysqld]
#skip-grant-tables
[root@wolf bin]# service mysqld restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
[root@wolf bin]# mysql -uroot -p123
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
[root@wolf bin]# service mysqld stop
2、在my.cnf中加入skip-grant-tables
[root@wolf bin]# vi /etc/my.cnf在[mysqld]的段中加上一句:skip-grant-tables
[mysqld]
skip-grant-tables
[root@wolf bin]# service mysqld stop
Shutting down MySQL.. [ OK ]
[root@wolf bin]# service mysqld start
Starting MySQL. [ OK ]
3、进入mysql
[root@wolf bin]# mysqlWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
4、update更新密码
mysql> UPDATE user SET Password = password ( '123' ) WHERE User='root';Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0
mysql> flush privileges ;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
5、在[mysqld]的段中删除或注释:skip-grant-tables
[mysqld]
#skip-grant-tables
[root@wolf bin]# service mysqld restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
[root@wolf bin]# mysql -uroot -p123
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, 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.
0 0
- mysql忘记密码处理
- mysql忘记密码的处理
- MySQL忘记密码处理方法
- MySQL忘记密码处理方法
- MySQL忘记密码处理方法
- mysql忘记密码怎么处理
- mysql忘记密码处理办法
- MySQL忘记密码处理方法
- linux mysql 密码忘记处理
- MySQL忘记密码处理方法解决办法
- MYSQL忘记密码的处理办法
- Linux下忘记mysql密码处理方法
- MySQL 忘记密码的处理办法
- MySQL 忘记 root 密码处理办法
- linux忘记mysql密码处理方法
- mysql 用户登录密码忘记处理
- mysql忘记root密码处理办法
- Linux MySQL 忘记root密码的处理
- Android Shape绘制虚线
- Linux获取监听指定端口的进程PID
- xmd:AP transaction timeout: ACK = 0x01, expected=0x02)
- 如何删除一张表重复的记录?
- redis登录测试hydra以及python脚本方式
- mysql忘记密码处理
- sdk中adb连接手机经常出现找不到设备的解决办法
- java使用List lists = new ArrayList()出错
- CSS width:100%
- Selenium 安装
- Android 7.0 SystemUI 之启动和状态栏和导航栏简介
- Yii2.0-advanced-10—数据库操作5(多数据库配置)
- 进程、线程与应用程序域
- CSCD(2015-2016年)来源期刊目录中国科学引文数据库