Yum升级mysql5.1到5.6

有一些虚拟机、云主机提供商仍然使用的是老版本的安装套件。预装的应用软件版本很低。

比如 techbrood.com 使用的云服务器,其中MySQL预装版本为老版本5.1.x。而最新的mysql版本在性能、功能、安全性等方面都有了很多的改进。

要从最新版本获益,你需要把现有系统升级到5.5+(最新的版本是5.7),我保守一点,升级到5.6.37。

有相关测试数据说明从5.1到5.5+,MySQL性能会有明显的提升,具体的需要自己建立测试环境去实践下。

首先更新rpm

从MySQL Yum仓库下载最新的rpm文件:http://dev.mysql.com/downloads/repo/yum/

(需要Oracle帐号以及填写一些使用信息,才能进入下载页面)

我需要下载的是:mysql-community-release-el6-5.noarch.rpm

安装这个发布包

yum localinstall mysql-community-release-el6-5.noarch.rpm

可以通过下面的命令来确认这个仓库被成功添加:

yum repolist enabled | grep "mysql.-community.

安装MySQL服务器

yum install mysql-community-server

新版本的目标文件是/usr/bin/mysql,如果原预装路径在/bin下面,则需要进行替换,最好是使用软链接,比如ln -s /usr/bin/mysql /bin/

这样在需要的时候,可以方便的在不同版本之间进行切换。(有时候需要版本回退来定位问题)

重启服务器就可以了

service mysqld restart

确认版本信息:

[root@west195246 bin]# mysql -V

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

在我进行过的几次软件升级之后,总会在 MySQL 的日志中见到“[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it”之类的错误。虽然这个错误修复起来很简单,却不容易引起注意。可以按如下方法修复:

错误日志如下:

[ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 640 pages (rounded down to MB) than specified in the .cnf file: initial 16384 pages, max 0 (relevant if non-zero) pages!

2017-09-01 09:15:06 5588 [ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data!

2017-09-01 09:15:06 5588 [ERROR] Plugin 'InnoDB' init function returned error.

2017-09-01 09:15:06 5588 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.

2017-09-01 09:15:06 5588 [ERROR] Unknown/unsupported storage engine: InnoDB

2017-09-01 09:15:06 5588 [ERROR] Aborting

错误提示如下:

[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it

[ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure

[ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure

[ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure

[ERROR] Native table 'performance_schema'.'threads' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure

[ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure

[ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure

[ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure

[Note] Event Scheduler: Loaded 0 events

[Note] /usr/libexec/mysqld: ready for connections.

Version: '5.5.20-log'  socket: '/var/lib/mysql/mysql.sock'  port: 0

处理方法:

#cd /var/lib/mysql

#rm -rf ib*

#service mysqld restart

需要按照如下的格式在 Linux 的 —— 而不是 MySQL 的 —— 命令提示符下运行:

#mysql_upgrade -u root -p

然后根据提示输入 mysql 的 root 帐户密码,修复过程就可自动运行。此时会有如下形式的提示信息输出:

mysql_upgrade -u root -p

Enter password:

Looking for 'mysql' as: mysql

Looking for 'mysqlcheck' as: mysqlcheck

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/lib/mysql/mysql.sock'

Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/lib/mysql/mysql.sock'

wp_commentmeta                               OK

wp_comments                                  OK

wp_links                                     OK

wp_options                                   OK

wp_postmeta                                  OK

wp_posts                                     OK

wp_term_relationships                        OK

wp_term_taxonomy                             OK

wp_terms                                     OK

wp_usermeta                                  OK

wp_users                                     OK

mysql.columns_priv                                 OK

mysql.db                                           OK

mysql.event                                        OK

mysql.func                                         OK

mysql.general_log                                  OK

mysql.help_category                                OK

mysql.help_keyword                                OK

mysql.help_relation                                OK

mysql.help_topic                                  OK

mysql.host                                         OK

mysql.ndb_binlog_index                             OK

mysql.plugin                                       OK

mysql.proc                                         OK

mysql.procs_priv                                   OK

mysql.servers                                     OK

mysql.slow_log                                    OK

mysql.tables_priv                                  OK

mysql.time_zone                                    OK

mysql.time_zone_leap_second                        OK

mysql.time_zone_name                               OK

mysql.time_zone_transition                         OK

mysql.time_zone_transition_type                    OK

mysql.user                                         OK

Running 'mysql_fix_privilege_tables'... OK

##service mysqld restart

yum mysql 5.1 innodb_Yum升级mysql5.1到5.6相关推荐

  1. linux mysql升级5.7_linux 升级 MySQL5.7.32 mysql升级(yum方式)

    5.7.31  -->  5.7.32 因为之前服务器装的mysql版本为5.7.31 绿盟做安全扫描的时候出的一下报告 故此对mysql升级 1. 数据库备份(全库) mysqldump -u ...

  2. centos mysql 升级 5.7_CentOS 7下升级MySQL5.7.23的一个坑

    发现CentOS 7下升级MySQL5.7.23的一个坑,以前面升级到MySQL 5.7.23的一个集群为例 在我们环境下打开文件描述符个数的参数open_files_limit在MySQL 5.6. ...

  3. mysql 升级到集群_MySQL Yum存储库 安装、升级、集群

    添加MySQL Yum存储库 首先,将MySQL Yum存储库添加到系统的存储库列表中.按着这些次序: 选择并下载适用于您的平台的发行包. 使用以下命令安装下载的发行包,替换platform-and- ...

  4. mysql 5.1.61_MySQL数据库之将Mysql 5.1.61升级为mysql 5.6.19

    本文主要向大家介绍了MySQL数据库之将Mysql 5.1.61升级为mysql 5.6.19 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. 环境:mysql-5.1.61 操 ...

  5. CentOS 5 升级mysql5.1启动服务时报错

    CentOS 5 升级mysql5.1启动服务时报错: [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had onl ...

  6. 在CentOS上把MySQL从5.5升级到5.6

    在CentOS上把MySQL从5.5升级到5.6 摘要:本文记录了在CentOS 6.3上,把MySQL从5.5.28升级到5.6.19的过程. 1. 概述 在我做的一个项目中,最近我对生产服务器上的 ...

  7. phpstudy2018升级MySQL5.5为5.7.24教程(图文)

    原文: phpstudy2018升级MySQL5.5为5.7教程(图文) 一.MySQL官网下载MySQL5.7版本,我这里下载的是MySQL5.7.24. 二.直接到D:phpStudyPHPTut ...

  8. centos 升级mysql_CentOS 7下升级MySQL5.7.23的一个坑

    发现CentOS 7下升级MySQL5.7.23的一个坑,以前面升级到MySQL 5.7.23的一个集群为例 在我们环境下打开文件描述符个数的参数open_files_limit在MySQL 5.6. ...

  9. centos 升级mysql5.6_centos6.9升级mysql5.1到mysql5.6

    一:查看下是否有系统自带MySQL的rpm包,如果有,需要删除自带的旧rpm包. [root@localhost mnt]# mysql -V mysql  Ver 14.14 Distrib 5.1 ...

最新文章

  1. python 配置文件对比_Python运维自动化之nginx配置文件对比操作示例
  2. 关于 \8 为56问题解答
  3. VTK:图像归一化用法实战
  4. 【solr基础教程之九】客户端
  5. Duplicate keys detected: '0'. This may cause an update error.
  6. 20145202马超《信息安全系统设计基础》实验四总结
  7. ubuntu 16.04 源码安装samba并且配置
  8. 5款WordPress推荐文章幻灯片插件
  9. 在silverlight中,创建webservice的client报错
  10. 奔图龙芯计算机认证报告,龙芯3A 1500 3U VPX加固计算机
  11. Python 字符串(二)
  12. 成功的MES项目,前期都做了些什么?
  13. typedef struct 和 struct 的区别
  14. Web Dev领域:2017精彩事件和 2018预测
  15. $.ajax data怎么处理_不用jsp怎么实现前后端交互?给萌新后端的ajax教程(2)
  16. php安装时候的源是什么,Windows安装源无效怎么办
  17. matlab信道容量函数,一般信道容量迭代算法1
  18. Java.day17
  19. IE安全系列:IE浏览器的技术变迁(上)
  20. 徒手写代码之《机器学习实战》-----决策树算法(2)(使用决策树预测隐形眼镜类型)

热门文章

  1. 前端学习(2022)vue之电商管理系统电商系统之创建order分支
  2. 第四十期:2019年度十大Web开发趋势
  3. 实例58:python
  4. 实例7:python
  5. linux下GPRS模块ppp拨号上网
  6. java proguard 使用_使用proguard混淆java9代码
  7. Eclipse 使用 CodeMix 插件 开发 Vue.js
  8. WinForm------GridControl单元格内容修改外表样式
  9. struts2-19-合法用户上传文件
  10. 搭建hexo博客并部署到github上