yum安装mysql8
#!/bin/bash curl -sO https://repo.mysql.com//mysql80-community-release-el7-5.noarch.rpm rpm -ivh mysql80-community-release-el7-5.noarch.rpm yum clean all yum makecache yum repolist | grep mysql yum install -y mysql-community-server systemctl disable mysqld systemctl start mysqld mysql -uroot -p$(cat /var/log/mysqld.log | grep password | awk -F"root@localhost: " '{print $2}') -e "alter user 'root@'localhost' identified by 'Huawei@9000'"
客户端登录mysql
mysql -uroot -pHuawei@900