仓库安装
[root@localhost ~]# rpm -ivh https://repo.mysql.com//mysql80-community-release-el9-1.noarch.rpm
[root@hezhihao ~]# dnf install mysql-server -y
本地安装
wget https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar
tar xvf mysql-8.0.32-1.el9.x86_64.rpm-bundle.tar
dnf localinstall mysql-community-server-8.0.32-1.el9.x86_64.rpm
systemctl start mysqld
systemctl status mysqld
grep 'temporary password' /var/log/mysqld.log
容器安装
nf install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
sed -i 's+download.docker.com+mirrors.aliyun.com/docker-ce+' /etc/yum.repos.d/docker-ce.repo
dnf install docker-ce --allowerasing -y
systemctl start docker
systemctl status docker
docker version
docker run hello-world
docker run --name mysqltest -e MYSQL_ROOT_PASSWORD=123456 -d mysql
docker ps
docker exec -it mysqltest /bin/bash
源码安装
groupadd mysql
useradd -r -g mysql -s /bin/false mysql
tar xvf mysql-boost-8.0.32.tar.gz
yum install gcc gcc-c++ cmake -y
yum install cmake gcc-toolset-12-gcc gcc-toolset-12-gcc-c++ gcc-toolset-12-binutils openssl-devel ncurses-devel libtirpc rpcgen git -y
rpm -ivh https://mirrors.tuna.tsinghua.edu.cn/centos-stream/9-stream/CRB/x86_64/os/Packages/libtirpc-devel-1.3.3-0.el9.x86_64.rpm