sudo yum -y install vim sudo setenforce Permissive sudo vim /etc/selinux/config SELINUX=permissive sudo systemctl stop firewalld.service sudo systemctl disable firewalld.service sudo su - echo -e '[mysql57-community] name=MySQL 5.7 Community Server baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql ' > /etc/yum.repos.d/mysql-community.repo exit sudo yum -y install mysql-community-server sudo mkdir -p /data/var/lib/mysql/ sudo chown mysql:mysql /data/var/lib/mysql/ sudo chmod o-r /data/var/lib/mysql/ sudo mkdir /data/var/log/ sudo touch /data/var/log/mysqld.log sudo chown mysql:mysql /data/var/log/mysqld.log sudo chmod o-r /data/var/log/mysqld.log sudo vim /etc/my.cnf [mysql] socket=/data/var/lib/mysql/mysql.sock [mysqld] datadir=/data/var/lib/mysql socket=/data/var/lib/mysql/mysql.sock log-error=/data/var/log/mysqld.log character-set-server=utf8mb4 collation-server=utf8mb4_general_ci # MySQL 8.0 utf8mb4_0900_ai_ci sudo systemctl enable mysqld.service sudo systemctl start mysqld.service sudo grep 'temporary password' /data/var/log/mysqld.log mysql -uroot -p ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!'; quit