[root@mysql ~]# grep "temporary password" /var/log/mysqld.log
2018-04-03T08:08:05.867624Z 1 [Note] A temporary password is generated for root@localhost: lPYjyC!--0e#
[root@mysql ~]# mysql -u root -p
Enter password:
...
mysql>
mysql> set password for 'root'@'localhost' =PASSWORD('abc123@A');
Query OK, 0 rows affected, 1 warning (0.00 sec)