Mysql官方介绍的方法rpm -Uvh https://repo.mysql.com/mysql80-community-release-el6.rpm
yum install -y mysql-community-server mysql-community
chkconfig --level 2345 mysqld on
启动[root@home ~]# /etc/init.d/mysqld restart
Stopping mysqld: [ OK ]
Initializing MySQL database: [ OK ]
Starting mysqld: [ OK ]
启动后,会生成一个初始密码在日志文件里/var/log/mysqld.log
查找初始密码[root@home ~]# grep 'temporary password' /var/log/mysqld.log
2018-05-06T16:50:09.694109Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: xxxxxxx
修改密码mysql> ALTER USER "root"@"localhost" IDENTIFIED BY "123456";
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
密码不符合安全规则,需要更换一个复杂点的密码,最好有数字,特殊字符,字母。