centos mysql忘记密码
2016-03-26 12:24
471 查看
1.停止mysql 服务:service mysqld stop;
2.vim命令打开mysql配置文件my.cnf(位置一般为:/etc/my.cnf)
3.在mysqld进程配置文件中添加skip-grant-tables,添加完成后保存。
4.重新打开mysql服务:service mysqld stop;
5.登陆mysql:mysql -u root -p; 不用输入密码登录mysql;
6.update user set password=password('newpassword') where user='root' (5.7以前版本)
update user set authentication_string=password('newpassword') where user='root' (5.7及以后版本)
7.在mysqld进程配置文件中注释skip-grant-tables,添加完成后保存
8.重启mysql服务
2.vim命令打开mysql配置文件my.cnf(位置一般为:/etc/my.cnf)
3.在mysqld进程配置文件中添加skip-grant-tables,添加完成后保存。
4.重新打开mysql服务:service mysqld stop;
5.登陆mysql:mysql -u root -p; 不用输入密码登录mysql;
6.update user set password=password('newpassword') where user='root' (5.7以前版本)
update user set authentication_string=password('newpassword') where user='root' (5.7及以后版本)
7.在mysqld进程配置文件中注释skip-grant-tables,添加完成后保存
8.重启mysql服务
相关文章推荐
- linux 命令
- [linux basic]基础--信号
- linux嵌入式qt的屏幕旋转与字体大小问题
- Linux操作系统 sleep(0)、sleep(1)和sleep(-1)的区别,他们各有什么作用
- linux挂载的磁盘类型
- win32平台而非linux平台下 深入分析Sleep(0)与Sleep(1)的区别
- ubuntu 交叉编译arm linux 内核小例子
- 交叉编译工具链介绍《Building Embedded Linux Systems》
- Linux并发(易混淆的基本API)
- Centos版Linux 一些常用操作命令
- linux内核用户地址空间分配与管理
- Linux下环境变量的设置
- Linux telnet简单实用方法
- Linux telnet简单实用方法
- 在Linux下安装python package到指定目录
- linux源码Makefile的详细分析
- linux 允许 icmp
- 虚拟机VMware自定义安装Linux redhat 之企业版CentOS
- [Linux]获取域名的ip地址和hostname(待续)
- Java开发必会的Linux命令