• Centos 5源及 MySQL 5.0安装


    最近需要使用古老的 MySQL 5.0版本做测试。经过版本历史查询得知MySQL 5.0是2005-2009年间的版本,为了成功安装不出现兼容性问题,该时间段对应的可选操作系统版本有 centos 5(没有选用我最熟悉的 debian/ubuntu 的原因是因为 MySQL 5.0.45版本没有对应的 deb pre-built 包)。在docker hub 中找到一个centos5的系统

     

    本地拉取镜像后运行起来,在更新这个新运行起来的系统软件仓库信息时,报了错误,如下图:

    经搜索查阅得知,centos 5已经EOL停止维护,且对应的源也下线了。所以在 update 仓库索引信息时,报了如上错误。在网上找到一个可用的腾讯源,如下:

    [base]
    name=CentOS-5.8 - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=5.8&arch=$basearch&repo=os
    baseurl=http://mirrors.cloud.tencent.com/centos-vault/5.8/os/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
     
    #released updates 
    [updates]
    name=CentOS-5.8 - Updates
    #mirrorlist=http://mirrorlist.centos.org/?release=5.8&arch=$basearch&repo=updates
    baseurl=http://mirrors.cloud.tencent.com/centos-vault/5.8/updates/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
     
    #additional packages that may be useful
    [extras]
    name=CentOS-5.8 - Extras
    #mirrorlist=http://mirrorlist.centos.org/?release=5.8&arch=$basearch&repo=extras
    baseurl=http://mirrors.cloud.tencent.com/centos-vault/5.8/extras/$basearch/
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
     
    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-5.8 - Plus
    #mirrorlist=http://mirrorlist.centos.org/?release=5.8&arch=$basearch&repo=centosplus
    baseurl=http://mirrors.cloud.tencent.com/centos-vault/5.8/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
     
    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-5.8 - Contrib
    #mirrorlist=http://mirrorlist.centos.org/?release=5.8&arch=$basearch&repo=contrib
    baseurl=http://mirrors.cloud.tencent.com/centos-vault/5.8/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

    将上面的源替换覆盖掉/etc/yum.repos.d/CentOS-Base.repo中的内容后,进行三步曲:

    yum clean all
    yum makecache
    yum update

    执行第二个命令时,依旧报错:

    Loaded plugins: fastestmirror
    Determining fastest mirrors
    YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
    Eg. Invalid release/repo/arch combination/
    removing mirrorlist with no valid mirrors: /var/cache/yum/libselinux/mirrorlist.txt
    Error: Cannot find a valid baseurl for repo: libselinux

    看报错内容,大致是libselinux这个仓库有问题,于是 rm /etc/yum.repos.d/libselinux.repo 删除这个仓库文件后,再继续前面三步曲中的命令。此时三个命令都执行成功。(如果依旧失败,可以看看是不是配置了fastestmirror,可以在/etc/yum/pluginconf.d/fastestmirror.conf文件中将enabled设为0以禁用)

    接着安装 MySQL server 包:yum localinstall MySQL-server-community-5.0.45-0.rhel5.x86_64.rpm -y,安装时报错“Public key for MySQL-server-community-5.0.45-0.rhel5.x86_64.rpm is not installed”,从返回的关键词看应该是 key 之类的安全校验没过,使用 yum localinstall MySQL-server-community-5.0.45-0.rhel5.x86_64.rpm -y --nogpgcheck命令(增加不检查 gpg key 选项)重新安装完成。

    再安装 MySQL client 包:yum localinstall MySQL-server-community-5.0.45-0.rhel5.x86_64.rpm -y --nogpgcheck,同样安装完成。

    最后根据安装MySQL server 包时给出的提示设置一次 root 密码。

     最终,大功告成。

  • 相关阅读:
    python开发线程:死锁和递归锁&信号量&定时器&线程queue&事件evevt
    python开发线程:线程&守护线程&全局解释器锁
    python开发进程:共享数据&进程池
    python开发进程:互斥锁(同步锁)&进程其他属性&进程间通信(queue)&生产者消费者模型
    学习笔记之Model selection and evaluation
    学习笔记之scikit-learn
    近期学习小结
    学习笔记之Problem Solving with Algorithms and Data Structures using Python
    Leetcode 3. Longest Substring Without Repeating Characters
    学习笔记之C / C++
  • 原文地址:https://www.cnblogs.com/pluse/p/15684221.html
Copyright © 2020-2023  润新知