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内只显示一条数据
  • 热门搜索
    怎么保存茶叶 蓟县生活网 足字旁有什么字 如何没有你 男人梦见蛇是什么预兆 o型血和a型血生的孩子是什么血型 生活电影 玉田生活网 怎么重置无线路由器 夫妻之间如何沟通