MySQL5.7 忘记root密码,怎么破?
MySQL5.7 忘记root密码,怎么破?
关服
# kill $mysql_pid
免密启动
# /usr/local/mysql57/bin/mysqld_safe --defaults-file=/etc/my.cnf --skip-grant-tables &
[1] 16688
2017-12-08T10:32:24.764472Z mysqld_safe Logging to '/data/database/mysql/host-30-0-0-196.err'.
2017-12-08T10:32:24.901997Z mysqld_safe Starting mysqld daemon with databases from /data/database/mysql
改密码呀
# /usr/local/mysql57/bin/mysql -S /tmp/mysql.sock
mysql> update mysql.user set authentication_string=password('4a68a3c809c38e31') where user='root' ;
Query OK, 1 row affected, 1 warning (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> quit
Bye
重启
# /usr/local/mysql57/bin/mysqladmin -S /tmp/mysql3308.sock shutdown
2017-12-08T10:33:02.360399Z mysqld_safe mysqld from pid file /data/database/mysql/host-30-0-0-196.pid ended
[1]+ Done 阿/usr/local/mysql57/bin/mysqld_safe --defaults-file=/etc/my.cnf --skip-grant-tables
# /usr/local/mysql57/bin/mysqld_safe --defaults-file=/etc/my.cnf
还得再改一次
You must reset your password using ALTER USER statement before executing this statement.
mysql> alter user root@localhost identified by '4a68a3c809c38e31';
Query OK, 0 rows affected (0.01 sec)
可以了
MySQL5.7 忘记root密码,怎么破?的更多相关文章
- MySql5.5忘记root密码的解决方法
试了很多方法,下面这种方法是确保可以成功的,呵呵.转载自:http://hi.baidu.com/bjben/item/722bb50b27baf1dcdde5b097. 申明:本文章应该属于转载,但 ...
- linux下mysql-5.6忘记root密码,重置root密码详细过程
在linux平台下使用mysql过程中忘记了root密码,对于运维和DBA来讲都是一件头疼的事情,下面来讲解下怎么进行重置mysql数据库root 密码: 1.首先停止mysql服务进程: 1 s ...
- linux下mysql5.7忘记root密码修改
朋友最近开始学服务器,mysql密码忘了又不会弄,让我帮忙解决一下.重置或修改mysql的root密码这种事平时很少做,还是得google辅助一下,于是弄完了写篇博客记录一下,方便若干月后又有人遇到这 ...
- centos7——mysql5.7忘记root密码的处理方式
参考资料:https://www.cnblogs.com/nangch/p/5521193.html 解决方法: 一.通过编辑/etc/my.cnf文件在[mysqld]下面加上skip-grant- ...
- Mysql5.7忘记root密码及mysql5.7修改root密码的方法
转自:http://www.jb51.net/article/77858.htm 关闭正在运行的 MySQL : ? 1 [root@www.woai.it ~]# service mysql sto ...
- 【转】windows下mysql5.1忘记root密码解决方法
步骤如下:1.停止mysql服务(以管理员身份,在cmd命令行下运行) net stop mysql D:\>net stop mysql MySQL 服务正在停止. MySQL 服务已成功停止 ...
- windows下mysql5.1忘记root密码解决方法[win7]
步骤如下:1.停止mysql服务(以管理员身份,在cmd命令行下运行) net stop mysql2.使用 mysqld –skip-grant-tables 命令启动mysql数据库 D:\> ...
- MYSQL5.7 忘记ROOT密码/初始化ROOT密码
编辑my.cnf允许空密码登录 [root@7Core ~]# vi /etc/my.cnf #在[mysqld]下加入一行 skip-grant-tables=1 重新启动Mysql服务 [root ...
- Mysql5.7忘记root密码及修改root密码的方法
Mysql 安装成功后,输入 mysql --version 显示版本如下 mysql Ver 14.14 Distrib 5.7.13-6, for Linux (x86_64) using 6.0 ...
随机推荐
- windows端口占用情况
https://jingyan.baidu.com/article/3c48dd34491d47e10be358b8.html netstat -ano,列出所有端口的情况. netstat -aon ...
- Apache与Tomcat整合的配置
下载jk连接器地址:http://archive.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/windows/ 把jk连接器即“mod_j ...
- 用websploit获取管理员后台地址
1, use web/dir_scanner 2, set TARGET http://www.****.com 3, run SOURCE: https://sourceforge.net/proj ...
- response的contentType的类型值Response.ContentType
MIME类型的含义 MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开.多用于指定一些客户端自定义的文件名,以及一些媒体 ...
- python threading acquire release
线程同步 //test.py import threading import time exitFlag = 0 class myThread (threading.Thread): def __in ...
- Jmeter获取响应结果中参数出现的次数
在测试中,有时候会遇到要统计响应结果中某个参数出现了多少次,如果量级很大,一个一个数不太现实,下面讲一下实现自动打印出该参数出现的次数的方法. 例如我的响应信息为:{"ip":&q ...
- cocos2d-js 遮挡层(禁止触摸事件传递层)
在游戏中,我们经常会碰到一些弹窗,这些弹窗禁止点透,也就是禁止触摸事件传递到底层,我们称之为遮挡层,这些遮挡层,需要开发遮挡层,我们首先得了解cocos2d-js的触摸传递机制,本文主要针对cocos ...
- InstallShield 读注册表函数 RegDBGetKeyValueEx ()执行失败
注: rtn = RegDBGetKeyValueEx(szKey, szNumName, nvType, svNumValue, nvSize); 调用失败如果这个函数的几个参数没有初始化的值,调用 ...
- jQuery-插入内容-新增内容
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- c# 使用MS SqlServer,连接成功,但是还报异常A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0。。。。
c# 使用MS SqlServer,连接成功,但是还报异常A connection was successfully established with the server, but then an ...