当前位置:网站首页>linux下数据库初始化密码
linux下数据库初始化密码
2022-08-04 10:50:00 【影风莫】
- 首先关闭数据库服务
service mysqld stop
- 修改my.cnf文件
执行vim /etc/my.cnf
在mysqld下添加
[mysqld]
skip-grant-tables
- 重启数据库
service mysqld start
- 刷新权限 (这里刷新以防报错,以踩坑!!)
flush privileges;
- 进入mysql
mysql -uroot -p
- 执行
use mysql;
- 修改密码
set password for [email protected] = password('your_password');
- 刷新权限表
flush privileges;
- 退出
quit;
- 删除 skip-grant-tables
- 先关闭服务
service mysqld stop
- 执行
vim /etc/my.cnf进入my.cnf文件
再删除下列这行代码
skip-grant-tables
- 重启mysql
service mysqld start
边栏推荐
- Introduction to Mysql storage engine
- MySQL:面试问的范式设计
- Doing Homework HDU - 1074
- vscode插件设置——Golang开发环境配置
- mae,mse,rmse分别利用sklearn和numpy实现
- MySQL之my.cnf配置文件
- Mysql高级篇学习总结13:多表连接查询语句优化方法(带join语句)
- Using .NET to simply implement a high-performance clone of Redis (2)
- 学会使用set和map的基本接口
- 有12个球,其中11个重量相等,只有1个不一样,不知是轻还是重.用天平秤三次,找出这个球.
猜你喜欢
随机推荐
粤黔协作,山海同心!578种贵州特色农产品走进粤港澳大湾区
Small program containers accelerate the construction of an integrated online government service platform
Four ways to traverse a Map
BOSS 直聘回应女大学生连遭两次性骚扰:高度重视求职者安全,可通过 App 等举报
北京大学,新迎3位副校长!其中一人为中科院院士!
iMeta | 德国国家肿瘤中心顾祖光发表复杂热图(ComplexHeatmap)可视化方法
华为云安全云脑,让企业云化运营更放心
MySQL核心SQL:结构化查询语句SQL、库操作、表操作、CRUD
Events in August | 51CTO's 17th Anniversary Celebration, post a blog post to get gifts such as tea sets/notebooks/T-shirts!
无代码平台多项选择入门教程
Heap Sort
美摄问答室|美映 VS 美摄云剪辑
What is the terminal privilege management
第二批养老理财试点产品发行 一小时销售20亿元
cubemx stm32 afm3000 module gas flow sensor driver code
A topic of map
Jina 实例秀|基于神经搜索的网络安全威胁检测(一)
小程序容器加快一体化在线政务服务平台建设
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之三
Business collocations









