centos部署之mysql修改密码

1 skip-grant-tables 不启动验证

/etc/my.cnf 增加一行

 use mysql 

mysql> update user set password=PASSWORD('p12#456')
    -> where user='root' and host='root' or host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit
Bye

posted on 2020-11-06 15:24  A欣  阅读(240)  评论(0编辑  收藏  举报

导航