groupadd mysql
useradd -g mysql mysql
3、上传二进制包到/usr/local/目次下,并解压,建立链接
cd /usr/local/
tar xvf mysql-8.0.25-linux-glibc2.12-x86_64.tar.xz
ln -s mysql-8.0.25-linux-glibc2.12-x86_64 mysql
4、 编辑设置文件
vi /etc/my.cnf
[client]
socket=/data/mysql/3306/data/mysql.sock
[mysqld]
basedir=/usr/local/mysql
datadir=/data/mysql/3306/data
user=mysql
port=3306
socket=/data/mysql/3306/data/mysql.sock
log_error=/data/mysql/3306/data/mysqld.err
log_timestamps=system
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd
[mysqld_safe]
log-error=/data/mysql/3306/data/mysqld.err
pid-file=/data/mysql/3306/data/mysqld.pid
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
5、创建数据目次,并修改其属主、属组