温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

发布时间:2020-05-19 15:41:56 来源:网络 阅读:818 作者:三月 栏目:MySQL数据库

文主要给大家介绍Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程,文章内容都是笔者用心摘选和编辑的,具有一定的针对性,对大家的参考意义还是比较大的,下面跟笔者一起了解下Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程吧。

一、光盘挂载镜像配置yum源

    1、挂载光盘镜像

    mount /dev/cdrom /media           #将光盘系统文件挂载到 /media文件夹下

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    2、配置光盘yum源 repo配置文件

    cd /etc/yum.repo.d    #切换到yum配置文件目录

    mkdir repos_bak      #创建repos配置文件备份文件夹

    mv *.repo repos_bak   #将原repo配置文件移动到repos_bak备份文件夹中

    touch Centos-Base.repo #创建Centos-Base.repo文件

    vi /Centos-Base.repo  #编辑Centos-Base.repo文件

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程    

    

    [base]

    name=Base

    baseurl=file:///media

    gpgcheck=0

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    

    yum clean all  #清除缓存

    yum makecache  #建立新缓存

    yum repolist  #查看yum的repo列表

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程


二、本地yum源安装相应软件包和数据库

    1、需要提前安装依赖的安装包:libaio ,perl,numactl

    yum -y install libaio

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    

    yum -y install perl

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    

    yum -y install numactl

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程


    2、搜索是否存在mysql文件

    rpm -qa|grep mysql   #查询mysql文件

    rpm -e mysql-libs-5.1.71.-1.el6.x86_64 --nodeps  #强力删除模式

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    3。上传mysql5.7的rpm包到/home/tools/mysql路径

    mkdir /home/tools/mysql   #创建/home/tools/mysql文件夹

    cd /home/tools/mysql    #切换到/home/tools/mysql文件夹

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    4.下载mysql5.7.13rpm包

    下载地址:http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar

     上传mysql5.7.13rpm包到/home/tools/mysql文件夹中

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    tar -xvf mysql-5.7.13-1.el6.x86_64.rpm-bundle.tar

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    5.安装mysql文件;

    rpm -ivh mysql-community-common-5.7.13-1.el6.x86_64.rpm

    rpm -ivh mysql-community-libs-5.7.13-1.el6.x86_64.rpm

    rpm -ivh mysql-community-client-5.7.13-1.el6.x86_64.rpm

    rpm -ivh mysql-community-server-5.7.13-1.el6.x86_64.rpm

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    6.启动mysql服务

    cd /usr/bin    

    mysqld --initialize --user=mysql #初始化数据库

    service mysqld start     #重启数据库

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程 

    7.查看mysql默认密码

    grep "root@localhost" /var/log/mysqld.log 查看数据库默认密码

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程


三、登录数据库,设置初始密码等

    1.登陆数据:    

    mysql -uroot -p

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    2.更改数据库登陆密码:

    mysql>alter user 'root'@'localhost' identified by 'passw0rd';

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

    3.允许远程连接

    mysql> use mysql;

    mysql> update user set host='%'where host='localhost' and user='root';

    mysql> flush privileges;

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

四、卸载光驱

    umonut /media/

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

五、验证数据库

    service mysqld stop

    service mysqld start

    mysql -uroot -ppassw0rd

    Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程

看完以上关于Centos6.5使用光盘挂载镜像配置yum源安装mysql5.7教程,很多读者朋友肯定多少有一定的了解,如需获取更多的行业知识信息 ,可以持续关注我们的行业资讯栏目的。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI