1. 安装MySQL单机
软件获取地址:https://downloads.mysql.com/archives/community/
# tar xf mysql-8.0.24-linux-glibc2.12-x86_64.tar.xz
# ln -s /opt/mysql-8.0.24-linux-glibc2.12-x86_64 /usr/local/mysql
# groupadd mysql
# useradd -r -g mysql -s /bin/false mysql
# id mysql
# yum remove mariadb-libs -y
# mkdir -p /data/3306/data
# chown -R mysql. /data
# ls -ld /data
# vim /etc/profile
export PATH=/usr/local/mysql/bin:$PATH
# mysqld --initialize-insecure
cat > /etc/my.cnf <<EOF
[mysqld]
user=mysql
basedir=/usr/local/mysql
datadir=/data/3306/data
port=3306
socket=/tmp/mysql.sock
[client]
socket=/tmp/mysql.sock
EOF
# cd /usr/local/mysql/support-files/
# cp mysql.server /etc/init.d/mysqld
# systemctl enable mysqld
# systemctl start mysqld
# systemctl status mysqld
Linux 二进制安装 MySQL8.0.24 [测试环境]