MySQL 5.7.11 重置root密码
1.修改/etc/my.conf,添加参数skip-grant-tables
2.重启mysql
service mysqld stop
service mysqld start
3.用root 直接登录
[root@bogon ~]# mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.11 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
4.修改密码
mysql> alter user 'root'@'localhost' identified by 'newpassword';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql>
这种方式不好使,换一种方式: mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> update user set authentication_string=PASSWORD('newpassword') where User='root';
Query OK, 1 row affected, 1 warning (0.07 sec)
Rows matched: 1 Changed: 1 Warnings: 1 mysql>
5.将/ect/my.conf 修改回来,重启mysql 测试新密码
[root@bogon ~]# service mysqld stop
Stopping mysqld: [ OK ]
[root@bogon ~]# service mysqld start
Starting mysqld: [ OK ]
[root@bogon ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.11 MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> 修改完成
MySQL 5.7.11 重置root密码的更多相关文章
- CentOs中mysql服务器重置root密码方法
1. 停止mysql: service mysqld stop 2. 编辑/etc/my.cnf,在[mysqld]这行后面加上skip-grant-tables ,并保存 3. 启动mysql: s ...
- MySQL重置root密码提示"Unknown column ‘password"的问题?
晚上打开MAC,发现root帐户突然不能正常登陆MySQL,于是打算重置密码,看了几篇文章,竟然重置不成功,总是得到Unknown column 'password'的错误,看了user的表结构也确实 ...
- mysql 重置root密码
最近又项目用到mysql 由于电脑上mysql是很久以前安装的root密码忘记了, 百度一下重置密码 Windows: 1.以系统管理员登陆: 2.停止MySQL服务: 3.进入CMD,进入MySQL ...
- MySQL重置root密码的几种方法(windows+Linux)
重置root密码的方法: windows系统下:1.停止mysql服务:2.新建文件init-root.txt,写上如下内容: update mysql.user set password = pas ...
- MySQL密码忘了怎么办?MySQL重置root密码方法
本文主要介绍Windows和Linux系统下忘记密码重置root密码的方法,需要的朋友可以参考下. MySQL有时候忘记了root密码是一件伤感的事.这里提供Windows 和 Linux 下的密码重 ...
- MySQL忘记root密码--不重启mysqd重置root密码
先提个问题:如何不重启mysqld,且没有权限修改用户账号和权限的情况下,如何重新设置root密码?不知道没关系,在此之前我也是不知道如何操作的,先看看下面的几种重置root密码的方法. 1.skip ...
- MySql登陆密码忘记了怎么办?MySQL重置root密码方法
本文主要介绍Windows和Linux系统下忘记密码重置root密码的方法,需要的朋友可以参考下. MySQL有时候忘记了root密码是一件伤感的事.这里提供Windows 和 Linux 下的密码重 ...
- linux环境下mysql 5.7.1X 如何重置root密码
1,vi /etc/my.cnf [mysqld]下加入参数skip-grant-tables 保存退出. 2,重启mysql [root@21yunwei src]# /etc/init.d/ ...
- 【转】CentOS6下安装mysql后,重置root密码方法
本文转自:CentOS6下安装mysql后,重置root密码方法 centos下安装mysql,居然不知道root用户密码,本想重装,不过还是先度娘了一些,发现这篇文章,刚好解决我的燃眉之急,太赞了. ...
随机推荐
- 【转】ViewGroup的onMeasure和onLayout分析
ViewGroup的onMeasure和onLayout分析 一个Viewgroup基本的继承类格式如下: 1 import android.content.Context; 2 import and ...
- jQuery的deferred对象详解(一)
最近一段时间,都在研究jquery里面的$.Deffered对象,几天都搞不明白,其中源码的运行机制,网上查找了相关的资料,<jQuery的deferred对象详解>阮一峰老师的文章,里面 ...
- 连续区间覆盖染色问题 ------ SHUOJ 1716
题目链接:http://202.121.199.212/JudgeOnline/problem.php?id=1716 [题意] 1到N的区间,一种操作让编号从a到b的数变为z,但不会低于2,问多次操 ...
- hdu 4115 2-SAT判定
思路:将每个回合的平手和赢最为一对对立状态.那么后面就是2-SAT判断了. #include<iostream> #include<cstdio> #include<al ...
- Matlab的GUI参数传递方式总结
MATLAB GUI传递方式 1.全局变量: 2.作为函数的参数传递: 3.利用控件的userdata数据: 4.为handles结构体添加新字段: 5.setappdata函数为句柄添加数据: 6. ...
- 什么是SMART原则?
SMART(S=Specific.M=Measurable.A=Attainable.R=Relevant.T=Time-bound)原则即目标管理,目标管理是使经理的工作变被动为主动的一个很好的手段 ...
- SQLSERVER数据库中的 时间函数
一.sql server日期时间函数 Sql Server中的日期与时间函数 1. 当前系统日期.时间 select getdate() 2. dateadd 在向指定日期加上一段时间的基础上,返 ...
- 兼容性调试-- 在谷歌浏览器中,td 设置colspan的失效的问题
通过设置table width="100%"table-layout="fixed" 解决
- nodejs7-buffer
buffer:js在后台操作的必须用到二进制,buffer类就是用于帮助我们处理这种情况 创建buffer对象: new Buffer(size):创建buff对象,有length属性 buf.f ...
- 第十篇、让UIScrollView的滚动条常显
UIScrollView滚动条一直显示 1.我们知道滚动条是一个UIImageView, 滚动条隐藏是因为设置了alpha属性为0, 所有我们写一个UIImageView的分类 #define noD ...