mysql5.7重置root密码的步骤详解
技术百科
不言
发布时间:2019-01-23
浏览: 次
本篇文章给大家带来的内容是关于mysql5.7重置root密码的步骤详解,有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。
安装完mysql5.7后忘记了密码,需要重置root密码;
第一步:修改配置文件免密码登录mysql
vim /etc/my.cnf ##在my.cnf的[mysqld]字段加入 skip-grant-tables ## 重启mysql服务 service mysqld restart
第二步:免密码登录mysql
mysql -u root ##password直接回车
第三步: 给root重置密码为空
mysql>use mysql; ## mysql 5.7.9以后废弃了password字段,字段名修改为authentication_string mysql>update user set authentication_string='' where user='root'; ## 刷新数据库 mysql>flush privileges;
第四步: root重置密码
退出mysql,删除/etc/my.cnf文件最后的 skip-grant-tables 重启mysql服务,使用root用户进行登录,因为上面设置了authentication_string为空,所以可以免密码登录。
alter user 'root'@'localhost' identified by '#新密码#';
功德圆满,修改成功
# 有一定
# 对你
# 重启
# 给大家
# 为空
# 第二步
# 第三步
# 配置文件
# mysql
# 第四步
# 功德圆满
相关栏目:
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
AI推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
SEO优化<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
技术百科<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
谷歌推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
百度推广<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
网络营销<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
案例网站<?muma echo $count; ?>
】
<?muma
$count = M('archives')->where(['typeid'=>$field['id']])->count();
?>
【
精选文章<?muma echo $count; ?>
】
相关推荐
- Windows10如何更改桌面图标间距_Win10
- c++中如何进行二进制文件读写_c++ read与
- Windows系统文件被保护机制阻止怎么办_权限不
- c# 在高并发场景下,委托和接口调用的性能对比
- 如何使用Golang template生成文本模板
- PHP主流架构怎么处理表单验证_规则与自定义【技巧
- Python与GPU加速技术_CUDA与Numba
- Windows 10怎么录屏_Windows 10
- Python对象生命周期管理_创建销毁解析【教程】
- Win11怎么开启远程桌面连接_Windows11
- c++如何实现多态性_c++ 虚函数表原理与动态绑
- TestNG的testng.xml配置文件怎么写
- Python正则表达式实战_模式匹配说明【教程】
- 如何在Golang中配置代码格式化工具_使用gof
- Windows11怎样开启游戏模式_Windows
- Windows Defender扫描失败怎么办_安
- c++ try_emplace用法_c++ map
- MAC如何隐藏文件夹及文件_MAC终端命令隐藏与第
- Win11怎么关闭OneDrive同步_Win11
- Win11时间怎么同步到原子钟 Win11高精度时
- Win11怎么更改任务栏位置_修改注册表将Win1
- Win11怎么连接投影仪_Win11多显示器投屏设
- Python解释执行模型_字节码流程说明【指导】
- Win10电脑怎么设置休眠快捷键_Windows1
- Python深度学习实战教程_神经网络模型构建与训
- Windows10系统服务优化指南_Win10禁用
- mac本地php环境如何开启curl_curl扩展
- php查询数据怎么分组_groupby分组查询配合
- Windows系统被恶意软件破坏后的恢复策略_错误
- Win11怎么开启远程桌面_Win11系统远程桌面
- 用lighttpd能运行php吗_lighttpd
- php转mp4怎么设置帧率_调整php生成mp4视
- Win11屏幕亮度突然变暗怎么解决_自动变暗问题处
- Win11怎么设置声音输出设备_Windows11
- Go 语言标准库为何不提供泛型 Contains
- Win11怎么设置快速访问_Windows11文件
- 如何在JavaScript中动态拼接PHP的bas
- 如何使用Golang管理跨项目依赖_Golang多
- PythonDocker高级项目部署教程_多容器管
- Ajax提交表单PHP怎么接收_处理Ajax发送的
- Windows怎样关闭开始菜单广告_Windows
- 如何使用Golang defer优化性能_减少不必
- c++23 std::expected怎么用 c+
- Avalonia如何实现跨窗口通信 Avaloni
- Windows的便笺功能如何使用?(桌面备忘技巧)
- windows如何备份注册表_windows导出和
- C++中的constexpr和const有什么区别
- Windows 11登录时提示“用户配置文件服务登
- Golang如何遍历目录文件_Golang fil
- Win11怎么关闭系统透明度_Windows11个

d字段,字段名修改为authentication_string
mysql>update user set authentication_string='' where user='root';
## 刷新数据库
mysql>flush privileges;
QQ客服