centos系统mysql忘记密码
2024-10-19 14:45:44
安装 mysql 之后,注意添加软连接
mysql 忘记密码操作,
vim /etc/my.cnf
在 [mysqld] 的段中加上一句:skip-grant-tables
重启 mysql 服务, service mysql restart
在输入 mysql -u root -p 输入回车即可进入 mysql 数据库
use mysql;
低版本修改:update user set Password = password('LDtianzhe.') where user = 'root';
高版本修改:update user set authentication_string=password('new password') where user = 'root';
再次vim /etc/my.cnf 注释掉 上面添加的重启服务即可再次进入数据库
如果出现此错误:
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
需要关闭保护模式
再次使用更新密码即可
退出,注释掉 skip-grant-tables
重启服务即可
最新文章
- 使用nose 进行Python项目的自动化测试
- iOS开源项目汇总
- Windows 之间用rsync同步数据(cwRsyncServer配置)
- android自定义View之仿通讯录侧边栏滑动,实现A-Z字母检索
- 九度OJ 1437 To Fill or Not to Fill -- 贪心算法
- 395. Coins in a Line II
- WPF 采用Border创建圆角
- JAVA排序(一) Comparable接口
- Git Hub,eclipse pull 出现问题
- dpdk组态 千兆网卡 驱动 失败 原因分析及 解决方案
- JAVA学习笔记 -- 包资源文件jar包裹
- 使用 ConfigSource 特性 拆分 Web.config 文件
- C/C++静态数组与动态数组的区别
- flutter 本地存储 (shared_preferences)
- vue-cli之打包多入口配置
- open jdk
- pandas 读取大文件 read_table C-engine CParserError: Error tokenizing data
- 小议常被忽略的a标签:visited属性的特殊用法
- php反射机制学习
- SharePoint 2013创建应用程序时IIS端口文件夹下没文件
热门文章
- 创建java文件和注释
- Dubbo和SpringCloud的优劣势比较--总体架构
- K8S(04)核心插件-coredns服务
- kubernetes实战-配置中心(三)配置服务使用apollo配置中心
- php 配置主机虚拟目录(使用虚拟域名访问 127.0.0.1) 一点也不好使?????
- vue slot nested bug
- 如何强制删除 baidu/tempdata/con.dat 的垃圾文件! How to fix locked SD card: 读卡器 损坏,补救措施!
- Apple Watch Series 6 无法使用截屏问题和解决方案
- js Array.from &; Array.of All In One
- Apple &; iOS &; Device Screen Sizes and Orientations &; React Native