yum mysql 5.1 innodb_Yum升级mysql5.1到5.6

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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/417901.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

遍历处理path及其子目录所有文件

遍历处理path及其子目录所有文件Sub ShowAllFile(Path) Set FSO CreateObject("Scripting.FileSystemObject") Set f FSO.GetFolder(Path) Set fc2 f.files For Each myfile in fc2 WScript.Echo path&"\"&myfile.name …

mysql用户和权限备份_备份MySQL用户和权限

Mysql用户在数据库Mysql的表用户中,为了备份这个表,你可以这样做:mysqldump -u root -p mysql user > UserTableBackup.sql对于备份所有mysql数据库并为每个数据库创建一个文件,你可以自己编写shell脚本,遵循一些可以帮助你的代码:# Get all database…

获取所有某格式文件到文件

扫描文件sub scan(folder_)Set fsocreateobject("scripting.filesystemobject") set folder_fso.getfolder(folder_)set filesfolder_.files遍历路径中的文件for each file in files extmid(file,InStrRev(file, ".")1) extlcase(ext) if extkuozhan then …

linux mysql 系统时间函数吗_Linux 宝库 - Mysql日期和时间函数不求人

对于每个类型拥有的值范围以及并且指定日期何时间值的有效格式的描述见7.3.6 日期和时间类型。这里是一个使用日期函数的例子。下面的查询选择了所有记录,其date_col的值是在最后30天以内:mysql> SELECT something FROM tableWHERE TO_DAYS(NOW()) - …

各种排序笔记---基于非比较排序部分

在计算机科学中,排序是一门基础的算法技术,许多算法都要以此作为基础,不同的排序算法有着不同的时间开销和空间开销。排序算法有非常多种,如我们最常用的快速排序和堆排序等算法,这些算法需要对序列中的数据进行比较&a…

vbs特殊符号

常数 值 描述 vbCr Chr(13) 回车符。 vbCrLf Chr(13) & Chr(10) 回车符与换行符。 vbFormFeed Chr(12) 换页符;在 Microsoft Windows 中不适用。 vbLf Chr(10) 换行符。 vbNewLine Chr(13) & Chr(10) 或 Chr(10) 平台指定的新行字符;适用于…

在mysql表中如何变换列和行_在SQL中转换列和行的简单方法?

有几种方法可以转换这些数据。在你最初的帖子中,你说PIVOT对于这个场景来说似乎太复杂了,但是可以很容易地使用UNPIVOT和PIVOTSQL Server中的函数。但是,如果您无法访问这些函数,则可以使用UNION ALL到UNPIVOT然后是一个具有CASE向…

powerpoint文字教程

建立空白演示文稿 如果所有模板都不满足要求,或者想制作一个特殊的、具有与众不同外观的演示文稿,可从一个空白演示文稿开始,自建背景设计、配色方案和一些样式特性。选择“空演示文稿”选项,或者在PowerPoint 2000窗口中&#xf…

不同语言,系统通过共享内存方式实现信息交互

1. 两个程序映射同一个文件到自己的地址空间2. 进程A先运行, 每隔两秒读取映射区域, 看是否发生变化. 3. 进程B后运行, 它修改映射区域, 然后推出, 此时进程A能够观察到存储映射区的变化一个读,一个写。转载于:https://www.cnblogs.com/swbzmx/p/5992679.html

如何使用用window.open()

oNewWindow window . open ( sURL , sName , sFeatures , bReplace ) 参数:sUrl : 可选项。字符串(String)。指定要被加载的HTML文档的 URL 地址。假如无指定值,则 about:blank 的新窗口会被显示。 sName : 可选项。字符串(String)。 指定打开的窗口…

mysql myisam/innodb高并发优化经验_MySQL MyISAM / PHP 高并发优化经验

最近做的一个应用,功能要求非常简单,就是 key/value 形式的存储,简单的 INSERT/SELECT,没有任何复杂查询,唯一的问题是量非常大,如果目前投入使用,初期的单表 insert 频率约 20Hz(次/秒&#xf…

SharePoint Framework 构建你的第一个web部件(三)

博客地址:http://blog.csdn.net/FoxDave本篇接上一讲,我们一起来看一下如何部署和测试本地开发的web部件。在SharePoint中预览web部件SharePoint工作台在SharePoint中被承载,用来在开发环境预览和测试本地web部件。它…

execCommand全集

JavaScript中的execCommand介绍 execCommand方法是执行一个对当前文档,当前选择或者给出范围的命令。处理Html数据时常用如下格式:document.execCommand(sCommand[,交互方式, 动态参数]) ,其中:sCommand为指令参数(如…

mysql my.ini位置错误_解决mysql导入数据量很大导致失败及查找my.ini 位置(my.ini)在哪...

数据库数据量很大的数据库导入到本地时,会等很久,然而等很久之后还是显示失败;这是就要看看自己本地的没mysql是否设置了超时等待,如果报相关time_out这些,可以把mysql.ini尾部添加max_allowed_packet、interactive_ti…

poj3186 Treats for the Cows(区间)

题目链接:http://poj.org/problem?id3186 题意:第一个数是N,接下来N个数,每次只能从队列的首或者尾取出元素。 ans每次取出的值*出列的序号。求ans的最大值。 样例 : input:5 1 2 1 5 2 output&#xff1a…

php5.2.5 mysql_IIS6 下安裝 PHP5.2.5 和 MySQL5.0 及概念澄清

假設 PHP 文件夾位於 D:/php_forIIS。1,php.ini 一定要拷貝到 Windows 文件夾下(重要且必須)。而 PHP4.x 版本可以不用這么做。在 Windows2003 Apache2.2 PHP5.x 下,也不用這么做。注意 extension 的加載配置:extension_dir "D:/php_…

OpenCV人脸检测并把图片写成avi视频

读出某一个文件夹下“jpg”后缀的全部图片后,用的OpenCV自带的人脸检测检测图片中的人脸,调整图片的大小写成一个avi视频。 主要是要记录一下CvVideoWriter的用法和如何从文件夹中读取某一后缀的全部文件。 代码: #include "stdafx.h&qu…

TextArea换行 滚动条

换行"\r\n" 滚动条自动滚动到结尾document.form1.text_information.doScroll(down); 滚动条顶部坐标document.form1.text_information.scrollTop; textarea自动滚动到结尾function add_information(info)//添加信息{ document.form1.text_information.valuedocument.…

leetcode83,删除有序链表中的重复元素

Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 难点就一个,就是要考虑到连续3个和3个以上的情况。 …

javascript各种事件

事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture(); event.srcElement.releaseCapture(); 事件按键 event.keyCode event.shiftKey event.altKey event.ctrlKey 事件返回值 event.returnValue 鼠标位置 event.x event.y 窗…