centos7修改mysql的密码
2016-03-23 00:00
190 查看
systemdis now used to look after mySQL instead of
mysqld_safe(which is why you get the
-bash: mysqld_safe: command not founderror - it's not installed)
The
usertable structure has changed.
So to reset the root password, you still start mySQL with
--skip-grant-tablesoptions and update the
usertable, but how you do it has changed.
1. Stop mysql: systemctl stop mysqld 2. Set the mySQL environment option: systemctl set-environment MYSQLD_OPTS="--skip-grant-tables" 3. Start mysql usig the options you just set: systemctl start mysqld 4. Login as root: mysql -u root 5. Update the root user password with these mysql commands: mysql> UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPassword') -> WHERE User = 'root' AND Host = 'localhost';mysql> FLUSH PRIVILEGES;mysql> quit 6. Stop mysql: systemctl stop mysqld 7. Unset the mySQL envitroment option so it starts normally next time: systemctl unset-environment MYSQLD_OPTS 8. Start mysql normally: systemctl start mysqld 9. Try to login using your new password: mysql -u root -p
相关文章推荐
- CentOS 7 的SELinux 和Firewall 配置简单要点
- Linux常用命令/工具(一)
- jenkins(二)linux slave构建
- 《Linux内核分析》第五课笔记
- Linux下安装mysql并自定义数据的存储路径
- CentOS、RHEL、SUSE平台的rpm包的简单制作
- [ 总结 ] Linux下两种常用的双网卡绑定
- 《Linux内核设计与实现》读书笔记 第十八章 调试
- linux下安装mysql
- Linux下的定时任务crontab设置
- 嵌入式Linux UDP通信:服务端程序
- linux epoll事件模型详解
- linux中的awk的详解
- LINUX下的简单方便的电子相册制作工具VideoParama,可替代会声会汇制作简单的电子相册
- 简析struct in_addr ,struct sockadd
- 如何查看,关闭和开启selinux
- VMware克隆CentOS6.7系统解决网卡无法启动问题
- Linux中的权限表示---字母表示和数字表示
- CentOS-6.3安装配置JDK-7
- windows上安装linux系统,黑屏进不到桌面解决办法