#!/bin/bash env echo "Download msyql5.7 rpm..." sudo yum install wget wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm ... ...
#!/bin/bash env echo "Download msyql5.7 rpm..." sudo yum install wget wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm echo "Start to install mysql5.7..." sudo yum -y install mysql57-community-release-el7-10.noarch.rpm sudo yum -y install mysql-community-server echo "啟動mysql 服務" sudo systemctl start mysqld.service echo "msyql 臨時密碼:" grep 'password' /var/log/mysqld.log |head -n 1 |grep -oE "localhost:(.+)$" | awk -F ':' '{print $2}' echo "請修改成自己需要的密碼"