wget mysql 5.6_一看必会系列:mysql 5.5版本升级到mysql 5.6版本

1.停用应用

2.备用所有库

3.增加源

yum -y install gcc gcc-c++ make cmake automake autoconf libxml2 libxml2-devel zlib zlib-devel ncurses ncurses-devel

yum -y install libaio libaio-devel net-tools wget

4.在线升级

5.备用方案。卸载后再安装,再导入数据

6.回退方案

——–正确的安装过程

[root@localhost ~]# rpm -ivh mysql-community-client-5.5.35-2.el7.x86_64.rpm

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-client-5.5.35-2.e################################# [100%]

error: unpacking of archive failed on file /usr/bin/mysqlcheck;5a97f082: cpio: read

error: mysql-community-client-5.5.35-2.el7.x86_64: install failed

[root@localhost ~]# rpm -ivh mysql-community-client-5.5.35-2.el7.x86_64.rpm

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-client-5.5.35-2.e################################# [100%]

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]# rpm -ivh mysql-community-server-5.5.35-2.el7.x86_64.rpm

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-server-5.5.35-2.e################################# [100%]

[root@localhost ~]# systemctl status mysql

Unit mysql.service could not be found.

[root@localhost ~]# systemctl status mysqld

● mysqld.service – MySQL Community Server

Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; vendor preset: disabled)

Active: inactive (dead)

[root@localhost ~]# systemctl restart mysqld

———–登陆测试

[root@localhost ~]# mysql -u root -p

Enter password:

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

Your MySQL connection id is 2

Server version: 5.5.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2013, 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>

mysql>

——————–5.5.45到5.6.34 升级过程

报错

[root@localhost ~]# rpm -ivh mysql-community-common-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-common-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing…                          ################################# [100%]

file /usr/share/mysql/errmsg-utf8.txt from install of mysql-community-common-5.6.34-2.el7.x86_64 conflicts with file from package mysql-community-common-5.5.35-2.el7.x86_64

解决  先卸载   mysql-community-common-5.5.35-2.el7.x86_64

[root@localhost ~]# rpm -qa |grep mysql

mysql-community-common-5.5.35-2.el7.x86_64

mysql-community-client-5.5.35-2.el7.x86_64

mysql-community-libs-5.5.35-2.el7.x86_64

mysql-community-server-5.5.35-2.el7.x86_64

[root@localhost ~]# yum remove mysql-community-common-5.5.35-2.el7.x86_64

Removed:

mysql-community-common.x86_64 0:5.5.35-2.el7

Dependency Removed:

mysql-community-client.x86_64 0:5.5.35-2.el7       mysql-community-libs.x86_64 0:5.5.35-2.el7       mysql-community-server.x86_64 0:5.5.35-2.el7

Complete!

开始安装

[root@localhost ~]# rpm -ivh mysql-community-common-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-common-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-common-5.6.34-2.e################################# [100%]

[root@localhost ~]# rpm -ivh mysql-community-client-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-client-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

mysql-community-libs(x86-64) >= 5.6.10 is needed by mysql-community-client-5.6.34-2.el7.x86_64

[root@localhost ~]# rpm -ivh mysql-community-libs-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-libs-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-libs-5.6.34-2.el7################################# [100%]

[root@localhost ~]# rpm -ivh mysql-community-client-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-client-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-client-5.6.34-2.e################################# [100%]

[root@localhost ~]# rpm -ivh mysql-community-server-5.6.34-2.el7.x86_64.rpm

warning: mysql-community-server-5.6.34-2.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-server-5.6.34-2.e################################# [100%]

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]#

[root@localhost ~]#

启动

systemctl restart  mysqld.service

[root@localhost ~]# !mysql

mysql -u root

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

Your MySQL connection id is 2

Server version: 5.6.34 MySQL Community Server (GPL)  —————————验证版本正确,数据都在

Copyright (c) 2000, 2016, 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 |

| bass               |

| budget             |

| mysql              |

| performance_schema |

| test               |

+——————–+

6 rows in set (0.05 sec)

mysql>

——-安装失败

[root@localhost ~]# rpm -ivh mysql-community-server-5.5.35-2.el7.x86_64.rpm

error: Failed dependencies:

mysql-community-client(x86-64) = 5.5.35-2.el7 is needed by mysql-community-server-5.5.35-2.el7.x86_64

[root@localhost ~]# rpm -ivh mysql-community-client-5.5.35-2.el7.x86_64.rpm

Preparing…                          ################################# [100%]

Updating / installing…

1:mysql-community-client-5.5.35-2.e################################# [100%]

error: unpacking of archive failed on file /usr/bin/mysqlcheck;5a97f082: cpio: read

error: mysql-community-client-5.5.35-2.el7.x86_64: install failed    ——-安装包损坏,重新下载

[root@localhost ~]#

———–报错

[root@localhost ~]# rpm -ivh mysql-community-server-5.5.35-2.el7.x86_64.rpm

error: Failed dependencies:

mysql-community-client(x86-64) = 5.5.35-2.el7 is needed by mysql-community-server-5.5.35-2.el7.x86_64

mysql-community-common(x86-64) = 5.5.35-2.el7 is needed by mysql-community-server-5.5.35-2.el7.x86_64

net-tools is needed by mysql-community-server-5.5.35-2.el7.x86_64

perl(DBI) is needed by mysql-community-server-5.5.35-2.el7.x86_64

————解决

按顺序安装

mysql-community-common

mysql-community-libs

mysql-community-client

mysql-community-server

net-tools is needed by mysql-community-server-5.5.35-2.el7.x86_64

perl(DBI) is needed by mysql-community-server-5.5.35-2.el7.x86_64

[root@localhost ~]# yum install -y net-tools  perl-DBI

———-解决

mysql-community-client(x86-64) = 5.5.35-2.el7 is needed by mysql-community-server-5.5.35-2.el7.x86_64

mysql-community-common(x86-64) = 5.5.35-2.el7 is needed by mysql-community-server-5.5.35-2.el7.x86_64

——–如有冲突

删除原有mariadb

[root@localhost ~]# rpm -qa |grep mariadb

mariadb-libs-5.5.52-1.el7.x86_64

[root@localhost ~]# yum remove -ymariadb-libs-5.5.52-1.el7.x86_64

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值