首页 > 技术文章 > 修改MySQL密码

zhao907 2021-10-25 14:25 原文

修改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;

推荐阅读