Centos7.4+Mysql8.0详细安装教程附安装包

安装环境:
系统:Cento7.4
Mysql版本:8.0.11
Mysql远程连接工具:Navicat

一 创建Mysql账户

    groupadd mysql
    useradd -g mysql mysql

二 准备安装包

    mysql-community-common-8.0.11-1.el7.x86_64.rpm 
    mysql-community-libs-8.0.11-1.el7.x86_64.rpm
    mysql-community-client-8.0.11-1.el7.x86_64.rpm 
    mysql-community-server-8.0.11-1.el7.x86_64.rpm

下载地址:链接:https://pan.baidu.com/s/1FbpAbpbu0IY0z3LMHHa9Zw 密码:eut2

三 安装Mysql

    安装之前需要检测系统是否有安装mysql
    rpm -qa | grep mysql 
    rpm -qa | grep mariadb
    如果有使用命令进行卸载
    rpm -e --nodeps XXX
    卸载完成之后按照下列顺序进行安装
    rpm -ivh mysql-community-common-8.0.11-1.el7.x86_64.rpm
    rpm -ivh mysql-community-libs-8.0.11-1.el7.x86_64.rpm 
    rpm -ivh mysql-community-client-8.0.11-1.el7.x86_64.rpm 
    rpm -ivh mysql-community-server-8.0.11-1.el7.x86_64.rpm

报错1
error: Failed dependencies: /usr/bin/perl is needed by
mysql-community-server-8.0.11-1.el7.x86_64 perl(Getopt::Long) is
needed by mysql-community-server-8.0.11-1.el7.x86_64 perl(strict)

解决1
yum install perl


报错2
error: Failed dependencies:
libaio.so.1()(64bit) is needed by mysql-community-server-8.0.11-1.el7.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by mysql-community-server-8.0.11-1.el7.x86_64
解决2
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm

四 初始mysqld –initialize启动数据库

    systemctl  start  mysqld

六 查看初始化密码

    vim /var/log/mysqld.log
    ;%WTMdmz0b#a

Centos7.4+Mysql8.0详细安装教程附安装包_第1张图片

七 链接Mysql

    mysql -uroot -p
    密码为上一步找到的初始化密码

八 重置密码

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'a123456';

九 开启远程连接权限

    CREATE USER 'admin'@'%' IDENTIFIED BY 'a123456';
    grant all on *.* to 'admin'@'%';
    flush PRIVILEGES; 

Centos7.4+Mysql8.0详细安装教程附安装包_第2张图片

十 连接报错

Centos7.4+Mysql8.0详细安装教程附安装包_第3张图片

    因为mysql8.0改变了加密方式,使用下面的命令即可解决问题
    ALTER USER 'admin'@'%' IDENTIFIED BY 'a123456' PASSWORD EXPIRE NEVER;
    ALTER USER 'admin'@'%' IDENTIFIED WITH mysql_native_password BY 'a123456'; 
    FLUSH PRIVILEGES;

你可能感兴趣的:(软件安装界面,运维)