[root@skywalking-java1 ~]# systemctl stop mysqld
[root@skywalking-java1 ~]# vim /etc/my.cnf
skip-grant-tables #添加这行
[root@skywalking-java1 ~]# systemctl start mysqld
mysql> select host,user from user;
+-----------+---------------+
| host | user |
+-----------+---------------+
| localhost | mysql.session |
| localhost | mysql.sys |
| localhost | root |
+-----------+---------------+
3 rows in set (0.00 sec)
mysql> update mysql.user set authentication_string=password('ewgregre6Li') where user='root' and host='localhost';
Query OK, 1 row affected, 1 warning (0.08 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
mysql> grant all privileges on *.* to'root'@'%' identified by 'a^X1wIKwskU0D6Li';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
修改密码成功后,退出,再进行关掉数据库,去掉上述添加的那行