#!/bin/sh
#
sudo yum -y localinstall mysql57-community-release-el7-9.noarch.rpm
sudo yum -y install mysql-community-server
sudo service mysqld start
#sudo grep 'temporary password' /var/log/mysqld.log
PASSWORD_STR=$(grep 'temporary password' /var/log/mysqld.log)
PASSWORD=$(echo $PASSWORD_STR| cut -c92-103)
mysql -uroot -p$PASSWORD --connect-expired-password < /home/opc/mysql-init.sql
