$ systemctl restart mysqld.service $ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.18
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. mysql> show tables; ERROR 1046 (3D000): No database selected mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'centos7'; ERROR 1819 (HY000): Your password does not satisfy the current policy requirements mysql> ALTER user 'root'@'localhost' IDENTIFIED BY 'MySQLNB8@2333'; Query OK, 0 rows affected (0.01 sec)