1、卸载mariadb
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost ~]# rpm -e --nodeps mariadb-libs-5.5.56-2.el7.x86_64
[root@localhost ~]# rpm -qa | grep mariadb
[root@localhost ~]#
2、 下载资源包
3、创建install和soft文件夹 将安装包导入install
4、解压到soft目录并改名 方便操作
[root@localhost ~]# cd /opt/install/
[root@localhost install]# ls
mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
[root@localhost install]# tar -Jxvf mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz -C ../soft/[root@localhost install]# cd ../soft/
[root@localhost soft]# ls
mysql-8.0.30-linux-glibc2.12-x86_64[root@localhost soft]# mv mysql-8.0.30-linux-glibc2.12-x86_64/ mysql8
[root@localhost soft]# ls
mysql8
5、增加用户
[root@localhost soft]# groupadd mysql
[root@localhost soft]# useradd -r -g mysql mysql
6、赋予权限
[root@localhost soft]# mkdir -p /opt/soft/mysql8/datas
[root@localhost soft]# chown -R mysql:mysql /opt/soft/mysql8/datas
[root@localhost soft]# chmod -R 770 /opt/soft/mysql8/datas
7、
[root@localhost mysql8]# vim ./my.cnf
8、配置环境变量并重新加载资源
[root@localhost mysql8]# vim /etc/profile
[root@localhost mysql8]# source /etc/profile
9、
mysqld_safe --defaults-file=/opt/soft/mysql8/my.cnf &