[root@fudanwuxi003 software]# yum install mysql-community-server [root@fudanwuxi003 software]# yum install mysql-server
[root@fudanwuxi003 ~]# rpm -qa | grep mysql
mysql-community-server-8.0.12-1.el7.x86_64
mysql80-community-release-el7-1.noarch
mysql-community-libs-8.0.12-1.el7.x86_64
mysql-community-common-8.0.12-1.el7.x86_64
mysql-community-libs-compat-8.0.12-1.el7.x86_64
mysql-community-client-8.0.12-1.el7.x86_64
[root@fudanwuxi003 lib]# systemctl start mysqld
[root@fudanwuxi003 lib]# systemctl enable mysqld
[root@fudanwuxi003 lib]# cat /var/log/mysqld.log |grep password #查看初始密码
2018-08-20T11:54:48.607318Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: +goyZ3q8w?!z
[root@fudanwuxi003 lib]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection> Server version: 8.0.12
Copyright (c) 2000, 2018, 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> show databases;
ERROR 1820 (HY000): You must reset your password using>
mysql>> Query OK, 0 rows affected (0.10 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.02 sec)
mysql>