修改MySQL密码

修改my.conf文件

跳过密码验证 skip-grant-tables 

修改密码:

mysql7版本:
mysql> update mysql.user set authentication_string=password('cy7m0ypu8CpLFperzI45') where user='root' and Host = 'localhost'; 
flush privileges;

mysql8版本:

  alter user 'root'@'%' identified by '123456';
  flush privileges;

原文地址:https://www.cnblogs.com/zhao907/p/15458417.html