美文网首页
centos7安装mysql5.6及所遇问题

centos7安装mysql5.6及所遇问题

作者: dotdiw | 来源:发表于2019-07-21 21:17 被阅读0次
    1. 卸载centos7自带MariaDB

    rpm –qa | grep mariadb



    rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

    1. 下载mysql版本 (等待下载完成)

    wget http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-5.6/MySQL-5.6.45-1.el7.x86_64.rpm-bundle.tar
    wget http://mirrors.ustc.edu.cn/mysql-ftp/Downloads/MySQL-5.6/MySQL-5.6.45-1.el7.x86_64.rpm-bundle.tar

    1. 解压文件

    tar -xvf MySQL-5.6.42-1.el7.x86_64.rpm-bundle.tar


    1. 安装

    rpm -ivh MySQL-server-5.6.42-1.el7.x86_64.rpm
    rpm -ivh MySQL-devel-5.6.42-1.el7.x86_64.rpm
    rpm -ivh MySQL-client-5.6.42-1.el7.x86_64.rpm

    1. 启动

    service mysql start

    1. 打开mysql输入

    msyql

    1. 创建mysql用户

    grant all privileges on *.* to mysql@'%' identified by '123456' with grant option;
    flush privileges;

    1. 如果有些配置不生效重启mysql

    service msyql restart;

    所遇问题

    安装过程中如果需要依赖包请自行yum安装

    • 问题1

    warning: MySQL-server-5.6.42-1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
    error: Failed dependencies:
    perl(Data::Dumper) is needed by MySQL-server-5.6.42-1.el7.x86_64

    • 解决办法:

    cd /etc/pki/rpm-gpg
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
    yum -y install perl perl-devel perl-Data-Dumper
    如果还不行:rpm -ivh MySQL-server-5.6.42-1.el7.x86_64.rpm --force --nodeps 强安装

    • 问题2:启动时如果报错:

    Starting MySQL.Logging to '/var/lib/mysql/izuf66sgxgoyt19dbhtlqdz.err'.
    .The server quit without updating PID file (/var/lib/mysql/[FAILED]xgoyt19dbhtlqdz.pid).

    • 解决办法:

    cat /var/lib/mysql/izuf66sgxgoyt19dbhtlqdz.err



    执行: mysql_install_db --user=mysql --ldata=/var/lib/mysql/

    相关文章

      网友评论

          本文标题:centos7安装mysql5.6及所遇问题

          本文链接:https://www.haomeiwen.com/subject/lkwplctx.html