Centos7.4 安装 MySQL8.0

第一步:下载

首先去mysql官网下载对应的mysql安装包: 

https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.11-linux-glibc2.12-x86_64.tar.gz

第二步:卸载mariadb

安装之前,我们需要将centos自带的mariadb卸载,mariadb属于mysql的一个分支,若不卸载就直接安装的话会报错。

#rpm -qa | grep mariadb //查看所有mariadb已安装的模块

#rpm -e mariadb-libs-5.5.44-1.el7_1.x86_64 //进行卸载

若提示有依赖包,卸载错误,则先卸载依赖

sudo rpm -e postfix-2:2.10.1-6.el7.x86_64

扫描二维码关注公众号,回复: 4713319 查看本文章

将所有的mariadb安装包都删除后,然后开始安装mysql

第三步:安装mysql

bin/mysqld --initialize --user=mysql

第四步:复制文件

bin/mysqld_safe --user=mysql

cp support-files/my-medium.cnf /etc/my.cnf

第五步:添加用户组

shell>groupadd mysql

shell> useradd -r -g mysql -s /bin/false mysql

猜你喜欢

转载自blog.csdn.net/m0_37598953/article/details/80054518