CentOs7 mysql更改密码
来源:互联网 发布:php小型博客开源框架 编辑:程序博客网 时间:2024/05/20 16:37
systemd
is now used to look after mySQL instead ofmysqld_safe
(which is why you get the-bash: mysqld_safe: command not found
error - it's not installed)The
user
table structure has changed.
So to reset the root password, you still start mySQL with --skip-grant-tables
options and update the user
table, but how you do it has changed.
1. Stop mysql:systemctl stop mysqld2. Set the mySQL environment option systemctl set-environment MYSQLD_OPTS="--skip-grant-tables"3. Start mysql usig the options you just setsystemctl start mysqld4. Login as rootmysql -u root5. Update the root user password with these mysql commandsmysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') -> WHERE User = 'root' AND Host = 'localhost';mysql> FLUSH PRIVILEGES;mysql> quit6. Stop mysqlsystemctl stop mysqld7. Unset the mySQL envitroment option so it starts normally next timesystemctl unset-environment MYSQLD_OPTS8. Start mysql normally:systemctl start mysqldTry to login using your new password:7. mysql -u root -p
Reference
As it says at http://dev.mysql.com/doc/refman/5.7/en/mysqld-safe.html,
0 0
- CentOs7 mysql更改密码
- centos7 root密码更改
- mysql 更改密码
- MySQL更改root密码
- mysql更改root密码
- 更改mysql root 密码
- mysql更改root密码
- mysql更改密码
- MySQL 更改root密码
- mysql更改root密码
- mysql密码更改
- mysql更改密码
- 更改mysql密码
- mysql 命令更改密码
- mysql更改root密码。
- mysql更改root密码
- mysql更改密码
- MySQL更改密码
- 青蛙过河
- 02、抽象工厂模式
- 浮点型的读取方式
- 1619-7 张良 十二月二十、二十一、二十二号总结 [连续第八十一、八十二、八十三天]
- web随性笔记01
- CentOs7 mysql更改密码
- web随性笔记02
- 系统调用与库函数的区别?
- linux套接字
- spring aop 配置文件参数介绍
- 关于浏览器内核你不得不了解的事
- 从头开始搭建一个dubbo+zookeeper平台
- 关于socket_create 报错,call to undefined function socket_create()的可能的解决方案。
- Homebrew安装软件包失败