Mysql修改root密码

  1. 关闭mysql服务
    1. linux下:mysql_safe --skip-grant-table
    2. window下:mysqld --skip-grant-table //高版本中无效
      • mysqld --console --skip-grant-table --shared-memory
  2. 执行update密码sql
    update mysql.user set authentication_string=password(" ") where mysql.user="root"
原文地址:https://www.cnblogs.com/zzw-847776943/p/12600123.html