centos下mysql 密码忘记怎么修改

 时间:2026-04-24 00:54:17

1、停止mysql:

# service mysqld stop

2、启动mysqld_safe模式:

# mysqld_safe --skip-grant-tables &

3、进入mysql:

# mysql

4、修改mysql为“new_password”:

> use mysql;

> UPDATE user SET Password = PASSWORD('new_password') WHERE user = 'root';

> flush privileges;

> quit;

5、重启mysql:

# service mysqld restart

  • 如何备份mysql,mysql整库备份方法
  • 使用dnspod添加dns解析记录
  • linux根分区满了怎么办
  • 如何使用xshell的断开连接功能?
  • FastReport.Net 报表DataBand内只显示一条数据
  • 热门搜索
    琳琅满目是什么意思 深圳有什么好玩的地方 怀孕生化是什么意思 对牛弹琴是什么意思 父爱是什么仿写句子 搬新家有什么讲究和准备的 什么变了作文 黄金什么牌子最好 ppd是什么 gsm是什么