专栏首页python33分钟,YUM升级MYSQL,5.1到5

3分钟,YUM升级MYSQL,5.1到5

本文介绍如何通过YUM升级Mysql的版本(默认用YUM安装的MySQL都是5.1的版本)

环境:CENTOS6.9

原Mysql 版本:5.1

新Mysql 版本:5.6

时间需要:3分钟以内

注意: 做任何动作前,先做好数据备份和恢复计划

[willson@heegw3o0cZ ~]$ sudo su - root

[root@heegw3o0cZ ~]#

[root@heegw3o0cZ ~]#

[root@heegw3o0cZ ~]# /etc/init.d/mysqld stop

Stopping mysqld:                                           [  OK  ]

[root@heegw3o0cZ~]# yum remove mysql

Loaded plugins: fastestmirror

Setting up Remove Process

Resolving Dependencies

--> Running transaction check

---> Package mysql.x86_64 0:5.1.73-8.el6_8 will be erased

--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-devel-5.1.73-8.el6_8.x86_64

--> Processing Dependency: mysql = 5.1.73-8.el6_8 for package: mysql-server-5.1.73-8.el6_8.x86_64

--> Running transaction check

---> Package mysql-devel.x86_64 0:5.1.73-8.el6_8 will be erased

---> Package mysql-server.x86_64 0:5.1.73-8.el6_8 will be erased

--> Processing Dependency: mysql-server for package: perl-Test-mysqld-0.17-3.el6.noarch

--> Running transaction check

---> Package perl-Test-mysqld.noarch 0:0.17-3.el6 will be erased

--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================

Package                 Arch          Version               Repository       Size

===================================================================================

Removing:

mysql                   x86_64        5.1.73-8.el6_8        @updates        2.4 M

Removing for dependencies:

mysql-devel             x86_64        5.1.73-8.el6_8        @updates        388 k

mysql-server            x86_64        5.1.73-8.el6_8        @updates         25 M

perl-Test-mysqld        noarch        0.17-3.el6            @epel            14 k

Transaction Summary

===================================================================================

Remove        4 Package(s)

Installed size: 27 M

Is this ok [y/N]: y

Downloading Packages:

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

  Erasing    : mysql-devel-5.1.73-8.el6_8.x86_64                               1/4

  Erasing    : perl-Test-mysqld-0.17-3.el6.noarch                              2/4

  Erasing    : mysql-server-5.1.73-8.el6_8.x86_64                              3/4

warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave

  Erasing    : mysql-5.1.73-8.el6_8.x86_64                                     4/4

  Verifying  : perl-Test-mysqld-0.17-3.el6.noarch                              1/4

  Verifying  : mysql-server-5.1.73-8.el6_8.x86_64                              2/4

  Verifying  : mysql-5.1.73-8.el6_8.x86_64                                     3/4

  Verifying  : mysql-devel-5.1.73-8.el6_8.x86_64                               4/4

Removed:

  mysql.x86_64 0:5.1.73-8.el6_8

Dependency Removed:

  mysql-devel.x86_64 0:5.1.73-8.el6_8      mysql-server.x86_64 0:5.1.73-8.el6_8

  perl-Test-mysqld.noarch 0:0.17-3.el6

Complete!

[root@heegw3o0cZ ~]#

[root@heegw3o0cZ ~]# rpm -Uvh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

Retrieving http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm

Preparing...                ########################################### [100%]

   1:mysql-community-release########################################### [100%]

[root@heegw3o0cZ ~]# yum install mysql-community-server

Loaded plugins: fastestmirror

Setting up Install Process

Determining fastest mirrors

* base: mirrors.aliyuncs.com

* epel: mirrors.aliyuncs.com

* extras: mirrors.aliyuncs.com

* updates: mirrors.aliyuncs.com

base                                                        | 3.7 kB     00:00

epel                                                        | 4.7 kB     00:00

epel/primary_db                                             | 6.0 MB     00:00

extras                                                      | 3.4 kB     00:00

extras/primary_db                                           |  29 kB     00:00

mysql-connectors-community                                  | 2.5 kB     00:00

mysql-connectors-community/primary_db                       |  17 kB     00:00

mysql-tools-community                                       | 2.5 kB     00:00

mysql-tools-community/primary_db                            |  38 kB     00:00

mysql56-community                                           | 2.5 kB     00:00

mysql56-community/primary_db                                | 197 kB     00:00

updates                                                     | 3.4 kB     00:00

updates/primary_db                                          | 5.3 MB     00:00

zabbix                                                      |  951 B     00:00

zabbix-non-supported                                        |  951 B     00:00

Resolving Dependencies

--> Running transaction check

---> Package mysql-community-server.x86_64 0:5.6.38-2.el6 will be installed

--> Processing Dependency: mysql-community-common(x86-64) = 5.6.38-2.el6 for package: mysql-community-server-5.6.38-2.el6.x86_64

--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.38-2.el6.x86_64

--> Running transaction check

---> Package mysql-community-client.x86_64 0:5.6.38-2.el6 will be installed

--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.38-2.el6.x86_64

---> Package mysql-community-common.x86_64 0:5.6.38-2.el6 will be installed

--> Running transaction check

---> Package mysql-community-libs.x86_64 0:5.6.38-2.el6 will be obsoleting

---> Package mysql-libs.x86_64 0:5.1.73-8.el6_8 will be obsoleted

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: redland-1.0.7-11.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-8.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: redland-1.0.7-11.el6.x86_64

--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: perl-DBD-MySQL-4.013-3.el6.x86_64

--> Running transaction check

---> Package mysql-community-libs-compat.x86_64 0:5.6.38-2.el6 will be obsoleting

--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================

Package                       Arch     Version          Repository           Size

===================================================================================

Installing:

mysql-community-libs          x86_64   5.6.38-2.el6     mysql56-community   1.9 M

     replacing  mysql-libs.x86_64 5.1.73-8.el6_8

mysql-community-libs-compat   x86_64   5.6.38-2.el6     mysql56-community   1.6 M

     replacing  mysql-libs.x86_64 5.1.73-8.el6_8

mysql-community-server        x86_64   5.6.38-2.el6     mysql56-community    55 M

Installing for dependencies:

mysql-community-client        x86_64   5.6.38-2.el6     mysql56-community    18 M

mysql-community-common        x86_64   5.6.38-2.el6     mysql56-community   308 k

Transaction Summary

===================================================================================

Install       5 Package(s)

Total download size: 77 M

Is this ok [y/N]: y

Downloading Packages:

(1/5): mysql-community-client-5.6.38-2.el6.x86_64.rpm       |  18 MB     00:01

(2/5): mysql-community-common-5.6.38-2.el6.x86_64.rpm       | 308 kB     00:00

(3/5): mysql-community-libs-5.6.38-2.el6.x86_64.rpm         | 1.9 MB     00:00

(4/5): mysql-community-libs-compat-5.6.38-2.el6.x86_64.rpm  | 1.6 MB     00:00

(5/5): mysql-community-server-5.6.38-2.el6.x86_64.rpm       |  55 MB     00:04

-----------------------------------------------------------------------------------

Total                                               11 MB/s |  77 MB     00:06

warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Importing GPG key 0x5072E1F5:

Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>

Package: mysql-community-release-el6-5.noarch (installed)

From   : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Is this ok [y/N]: y

Running rpm_check_debug

Running Transaction Test

Transaction Test Succeeded

Running Transaction

Warning: RPMDB altered outside of yum.

** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:

tomcat6-6.0.24-98.el6_8.noarch has missing requires of tomcat6-lib = ('0', '6.0.24', '98.el6_8')

tomcat6-admin-webapps-6.0.24-105.el6_8.noarch has missing requires of tomcat6 = ('0', '6.0.24', '105.el6_8')

tomcat6-webapps-6.0.24-105.el6_8.noarch has missing requires of tomcat6 = ('0', '6.0.24', '105.el6_8')

  Installing : mysql-community-common-5.6.38-2.el6.x86_64                      1/6

  Installing : mysql-community-libs-5.6.38-2.el6.x86_64                        2/6

  Installing : mysql-community-client-5.6.38-2.el6.x86_64                      3/6

  Installing : mysql-community-server-5.6.38-2.el6.x86_64                      4/6

warning: /etc/my.cnf created as /etc/my.cnf.rpmnew

  Installing : mysql-community-libs-compat-5.6.38-2.el6.x86_64                 5/6

  Erasing    : mysql-libs-5.1.73-8.el6_8.x86_64                                6/6

  Verifying  : mysql-community-common-5.6.38-2.el6.x86_64                      1/6

  Verifying  : mysql-community-libs-5.6.38-2.el6.x86_64                        2/6

  Verifying  : mysql-community-libs-compat-5.6.38-2.el6.x86_64                 3/6

  Verifying  : mysql-community-client-5.6.38-2.el6.x86_64                      4/6

  Verifying  : mysql-community-server-5.6.38-2.el6.x86_64                      5/6

  Verifying  : mysql-libs-5.1.73-8.el6_8.x86_64                                6/6

Installed:

  mysql-community-libs.x86_64 0:5.6.38-2.el6

  mysql-community-libs-compat.x86_64 0:5.6.38-2.el6

  mysql-community-server.x86_64 0:5.6.38-2.el6

Dependency Installed:

  mysql-community-client.x86_64 0:5.6.38-2.el6

  mysql-community-common.x86_64 0:5.6.38-2.el6

Replaced:

  mysql-libs.x86_64 0:5.1.73-8.el6_8

Complete!

[root@heegw3o0cZ ~]# mysql -V

mysql  Ver 14.14 Distrib 5.6.38, for Linux (x86_64) using  EditLine wrapper

[root@heegw3o0cZ ~]# /etc/init.d/mysqld start

Starting mysqld:                                           [  OK  ]

[root@heegw3o0cZ ~]# mysql

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.38 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| rt3                |

+--------------------+

7 rows in set (0.00 sec)

mysql>

本文参与腾讯云自媒体分享计划,欢迎正在阅读的你也加入,一起分享。

我来说两句

0 条评论
登录 后参与评论

相关文章

  • Python3网络爬虫实战-8、APP爬

    MitmProxy 是一个支持 HTTP 和 HTTPS 的抓包程序,类似 Fiddler、Charles 的功能,只不过它是一个控制台的形式操作。 同时 Mi...

    py3study
  • Ubuntu pip3安装uwsgi报错

    py3study
  • 计算器程序

    py3study
  • 在CentOS7上安装MySQL的心路历程

    今天突然心血来潮,想把博客转移到到自己的云服务器上,嗯,想法不错,正好能练练手(后来找到了别的解决方案Hexo,才发现自己有多幼稚,果然是脑子一热,啥事想得出来...

    双面人
  • cronie所依赖的包

    CentOS6.3 x86_64 最小化安装版安装cronie yum -y install cronie 通过这个命令可得出安装cronie所得依赖包如下

    三杯水Plus
  • Linux 中不用再 ↑ ↓ 了

    Linux 下,如果要执行一条或多条之前输过的指令,要怎么处理?很多人会想到使用上下箭头去翻查历史输入的命令。这当然是可以了,除了这种方法,本文再介绍另外 5 ...

    LieBrother
  • docker安装

    http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

    dodo_lihao
  • 元学习—Meta Learning的兴起

    【导读】元学习描述了训练深度神经网络相关的更高级别的元素。在深度学习文献中,“元学习”一词经常表示神经网络架构的自动化设计,经常引用“ AutoML”,“少量学...

    Amusi
  • Struts2学习---result结果集 result type:全局结果集:动态结果集带有参数的结果集

    这一章节主要介绍如何配置结果集,分为以下几个知识点: 结果集类型(result type) 全局结果集(global types) 动态结果集(dynamic ...

    MindMrWang
  • Oculus设计师发明史上最时尚LED口罩!图像可变能发声,售价90美元,还能DIY

    现任职于Oculus的产品设计经理的Chelsea Klukas就是其中一位,她将科技元素融入口罩,用LED屏幕实现了画面可变的口罩表面,创意十足。

    大数据文摘

扫码关注云+社区

领取腾讯云代金券