centos部署之mysql修改密码
1 skip-grant-tables 不启动验证
/etc/my.cnf 增加一行
use mysql
2
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