mysql5.7.26-忘记密码(CentOS为例)
- 编辑 my.cnf
[mysqld]下插入 skip-grant-tables
[root@VM_0_7_centos mysql]# vim /etc/my.cnf
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html [mysqld]
skip-grant-tables #
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock # Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
- 重启 MySQL 服务
[root@VM_0_7_centos mysql]# service mysqld restart
- 进入MySQL
[root@VM_0_7_centos mysql]# mysql -uroot
- 更新密码
- flush privileges;
- alter user 'root'@'localhost' identified with mysql_native_password by '';
- flush privileges;
- exit;
- 编辑 my.cnf 注释掉 skip-grant-tables
- 重启MySQL服务
[root@VM_0_7_centos mysql]# service mysqld restart
- 进入MySQL 输入密码
[root@VM_0_7_centos mysql]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.7. MySQL Community Server (GPL) Copyright (c) , , 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>
- 结束
mysql5.7.26-忘记密码(CentOS为例)的更多相关文章
- MySQL5.7.26 忘记Root密码小计
以前直接修改mysql.user就ok了,现在不行了,正好虚拟机MySQL的root密码忘记了,就简单记录下:(本方法不适合互联网线上项目,除非你不在意这段时间的损失) PS:以UbuntuServe ...
- Mysql5.7在忘记密码的情况下如何修改密码?
1.停止服务 2.mysqld --skip-grant-tables 3.回车之后就不要动了,再新打开一个命令提示符窗口,同样进入mysql的安装目录下, 输入:mysql -u root -p 密 ...
- mysql5.7忘记密码修改方法
mysql5.7忘记密码修改方法 mysql是开发中最常用的关系数据库之一.一般在安装数据库到时候会自定义root密码,有时候会忘记该密码,这时候需要对数据库进行密码修改. 一.windows下更改m ...
- CentOS 6.5 MySQL5.6.26源码安装
一.源码安装cmake工具 从mysql5.5起,mysql源码安装开始使用cmake wget http://cmake.org/files/v3.2/cmake-3.2.3.tar.gztar z ...
- Centos忘记密码怎么修改
使用Centos系统忘记密码 在我们日常使用Centos系统时,有些人不免会出现一个共同的问题:忘记登录密码! 我们总不能再重装一遍吧! 接下来我们就分两种情况来看看: Centos系统在云服务器 C ...
- Linux-1:安装&忘记密码&CRT连接centos 6.5
我是在虚拟机VM安装的centos 6.5 一.Linux安装 Ctrl + Alt:鼠标退出LINUX界面 安装我是参考,当然也可以根据网上教程安装:http://oldboy.blog.51cto ...
- CentOS 6忘记密码解决办法,root和普通用户均可
转自nui111的文章:http://blog.csdn.net/nui111/article/details/28007357 说明 操作系统:CentOS 6.0 遇到问题:忘记管理员账号root ...
- Linux下Mysql5.7忘记密码
一.问题 linux下的mysql5.7忘记密码 二.解决 第一步:打开mysql5.7的配置文件my.cnf,并在里面增加一行:skip-grant-tables 保存并退出(:wq) [roo ...
- CentOS忘记密码修改方案以及centos卡在开机登录界面,命令失效的解决方法
CentOS忘记密码修改方案 应用场景 linux管理员忘记root密码,需要进行找回操作. 注意事项:本文基于CentOS7.2环境进行操作的,由于CentOS的版本之间是有差异的,继续之前请先确定 ...
- mysql5.7忘记密码
注意:mysql5.7 user表密码字段由password改为authentication_string 1.service mysql stop 2.mysqld_safe --skip-gran ...
随机推荐
- 惠普服务器DL360G6安装ESXi主机后遗忘密码用u盘重置密码
惠普服务器DL360G6安装ESXi主机后遗忘密码重置密码 先用rufus制作U盘启动盘,启动盘一定要用惠普专用hpe的esxi版本,否则安装会报错, 下载https://www.iplaysoft. ...
- rosbag record and play
话题录制: 录制所有发布出来的话题,此时默认将话题保存在一个以当时时间戳命名的文件夹中: $ rosbag record -a1 录制指定话题: $ rosbag record /topic1 ...
- Mybaits二级缓存的使用与配置
什么是延迟加载 resultMap中的association和collection标签具有延迟加载的功能. 延迟加载的意思是说,在关联查询时,利用延迟加载,先加载主信息.使用关联信息时再去加载关联信 ...
- 1、maven的下载,安装,配置
下载 1.maven官方下载地址: http://maven.apache.org/download.cgi 进入官网: 下载各历史版本官方地址: https://archive.apache.org ...
- Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord.
原文出处: https://blog.csdn.net/hyunbar/article/details/80111947 运行 supervisord -c /etc/supervisor/super ...
- Linux centos 解决"不在 sudoers 文件中。此事将被报告"的问题
第一部分讲解如何从普通用户到root用户 网上看了很多,其实就是执行 su root ,然后输入当前用户密码,这个时候可能报错 这个问题不大,执行一下提示的语句: abrt-auto-reportin ...
- Failure to find com.oracle:ojdbc6:jar:11.2.0.1.0
报错原因:oracle的ojdbc.jar是收费的,maven的中央仓库是没有的,需要下载到本地,然后打包进maven仓库 1.下载ojdbc6-11.2.0.1.0.jar包 http://cent ...
- Cocos2d-X网络编程(4) Cocos2d中的网络通信协议——Socket通信
Socket,俗称网络套接字,本身并不是协议,而是一个调用接口,是对TCP/IP协议的封装和应用,.提供了一系列方法方便开发者进行网络通讯. TCP/IP协议是使用最早的通讯协议,它是传输层协议,主要 ...
- 【Qt开发】【Linux开发】QT设置环境变量QWS_DISPLAY
QT设置环境变量QWS_DISPLAY 当应用程序./myQtApp -qws启动时,会去检测QWS_DISPLAY这个环境变量, 判断界面最终显示在哪个framebuffer中, 如果是虚拟的fra ...
- 多线程15-ReaderWriterLockSlim
)); } ); rwl.EnterUpgradeableReadLock(); ...