centos 7忘记mysql的密码是解决办法
2017-12-22 11:27
417 查看
方法一、找回安装是的初始密码:
1、grep 'temporary password' /var/log/mysqld.log
方法二、使用操作系统账号和密码,进行修改密码
1、mysql -uroot -p
2、输入你的centos的密码
3、UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') WHERE User = 'root' AND Host = 'localhost';
注:如果显示 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,说明你的密码不符合安全要求,
4、FLUSH PRIVILEGES;
5、quit;
方法三、强制进行修改密码
1、systemctl stop mysqld
2、systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
3、systemctl start mysqld
4、mysql -u root
5、UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') WHERE User = 'root' AND Host = 'localhost';
注:如果显示 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,说明你的密码不符合安全要求,
6、FLUSH PRIVILEGES;
7、quit;
1、grep 'temporary password' /var/log/mysqld.log
方法二、使用操作系统账号和密码,进行修改密码
1、mysql -uroot -p
2、输入你的centos的密码
3、UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') WHERE User = 'root' AND Host = 'localhost';
注:如果显示 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,说明你的密码不符合安全要求,
4、FLUSH PRIVILEGES;
5、quit;
方法三、强制进行修改密码
1、systemctl stop mysqld
2、systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"
3、systemctl start mysqld
4、mysql -u root
5、UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') WHERE User = 'root' AND Host = 'localhost';
注:如果显示 ERROR 1819 (HY000): Your password does not satisfy the current policy requirements,说明你的密码不符合安全要求,
6、FLUSH PRIVILEGES;
7、quit;
相关文章推荐
- CentOS下忘记mysql密码的解决办法
- CentOS下忘记mysql密码的解决办法
- centos下忘记mysql密码的解决办法一:(停掉正在运行的mysql) [root@NetDakVPS ~]# service mysqld stop 二:使用 “–skip-grant-tabl
- CentOS下MySQL的root用户密码忘记解决办法
- centos 7 mysql 安装 和 mysql 密码忘记解决办法
- MySQL+Centos忘记root密码的解决办法(重置root密码)
- 云服务器 ECS MySQL 忘记 root 密码解决办法
- CentOS忘记root密码解决办法
- CentOS 7忘记root密码解决办法
- CentOS忘记root密码解决办法
- windows下忘记mysql超级管理员root密码的解决办法
- CentOS下MySQL忘记root密码解决方法
- CentOS 6.5忘记root密码的解决办法(CentOS输入密码提示login incorrect)
- CentOS下MySQL忘记root密码解决方法【转载】
- windows下忘记mysql超级管理员root密码的解决办法
- linux 忘记root(这里以centos 6.5为例)密码的解决办法
- CentOS下MySQL忘记root密码解决方法【转载】
- mac下mysql忘记root密码的解决办法
- MySQL修改密码 MySQL忘记密码的解决办法
- centos 6.5 忘记root密码的解决办法