centos7下 mysql5.7 忘记密码重置
2017-08-11 15:13
363 查看
MySQL 5.7 开始 数据库中的user
表中已经将password 字段更改为authentication_string 所以更改密码 直接使用 update mysql.user
set authentication_string=password("123456") where user="root";
完整的修改数据库密码的操作
1. vim /etc/my.cnf 加入skip-grant-tables
2.重启mysql systemctl restart mysqld
3.终端输入mysql 直接登录到数据库 use mysql ;
4.update mysql.user set authentication_string=password("123456") where user="root";
5.编辑my.cnf文件删掉skip-grant-tables 这一行,然后重启MySQL,/etc/init.d/mysqld restart,否则MySQL仍能免密码登录
6.mysql -uroot -p
接下来MySQL就可以正常运行了。
表中已经将password 字段更改为authentication_string 所以更改密码 直接使用 update mysql.user
set authentication_string=password("123456") where user="root";
完整的修改数据库密码的操作
1. vim /etc/my.cnf 加入skip-grant-tables
2.重启mysql systemctl restart mysqld
3.终端输入mysql 直接登录到数据库 use mysql ;
4.update mysql.user set authentication_string=password("123456") where user="root";
5.编辑my.cnf文件删掉skip-grant-tables 这一行,然后重启MySQL,/etc/init.d/mysqld restart,否则MySQL仍能免密码登录
6.mysql -uroot -p
接下来MySQL就可以正常运行了。
相关文章推荐
- [MySQL] CentOS7 mysql5.7 忘记root密码 重置root密码 1045
- 【Day46】CentOS中安装了MySQL 5.7后忘记密码问题解决
- MySQL 5.7忘记密码重置方法
- CentOS 7 安装及卸载、重置登录密码 MySql5.7
- Mysql 5.7 忘记root密码或重置密码的详细方法
- Centos 7 下重置mysql5.7密码
- Mysql 5.7 忘记root密码或重置密码的详细方法
- centos6.9下mysql忘记密码后,绕过密码重置方案(重置实测)
- CentOS 7下安装MySQL后重置root密码方法
- Centos7下MYSQL无密码重置
- CentOS MYSQL的ROOT密码忘记以及ROOT远程权限的强制重置
- centOS 6.5 mysql5.6忘记密码后重置密码
- Mysql 5.7 忘记密码或重置密码
- centos7下忘记Mysql密码并重设
- ubuntu 16.04 下重置 MySQL 5.7 的密码(忘记密码)
- Mysql 5.7 忘记密码或重置密码
- MySQL 5.7忘记密码如何重置
- MySQL+Centos忘记root密码的解决办法(重置root密码)
- CentOS 7 install mysql 5.7 以及重置密码
- MySQL 5.7 忘记密码 重置密码 my.ini示例