Centos 6.7 yum 升级mysql的版本

原来系统的mysql的版本信息如下:

yum info mysql-server 

Mysql安装包的信息:

yum 命令补充:

yum info package1 显示安装包信息package1

 

运行的结果,默认 yum install mysql-server安装的版本是mysql5.1的版本,现在要借着官网

http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm  rpm 安装包更新mysql的rpm安装包

查看当前mysql的版本:
[root@debug_test src]# yum info mysql-server
Loaded plugins: security
Installed Packages
Name        : mysql-server
Arch        : x86_64
Version     : 5.1.73
Release     : 8.el6_8
Size        : 25 M
Repo        : installed
From repo   : updates
Summary     : The MySQL server and related files
URL         : http://www.mysql.com
License     : GPLv2 with exceptions
Description : MySQL is a multi-user, multi-threaded SQL database server. MySQL is a
            : client/server implementation consisting of a server daemon (mysqld)
            : and many different client programs and libraries. This package contains
            : the MySQL server and some accompanying files and directories.

下载Mysql 的rpm 安装库

wget http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

下载后安装:

[root@debug_test src]# rpm -ivh mysql-community-release-el6-5.noarch.rpm 
Preparing...                ########################################### [100%]
   1:mysql-community-release########################################### [100%]
[root@debug_test src]# rpm -ivh mysql-community-release-el6-5.noarch.rpm 
Preparing...                ########################################### [100%]
    package mysql-community-release-el6-5.noarch is already installed

可以查看yum 安装库中关于Mysql的可以安装的Mysql的版本的信息

更新以后查看mysql可以安装的版本:

[root@debug_test src]# yum list |grep -i mysql
mysql-community-client.x86_64              5.6.35-2.el6                @mysql56-community
mysql-community-common.x86_64              5.6.35-2.el6                @mysql56-community
mysql-community-devel.x86_64               5.6.35-2.el6                @mysql56-community
mysql-community-libs.x86_64                5.6.35-2.el6                @mysql56-community
mysql-community-libs-compat.x86_64         5.6.35-2.el6                @mysql56-community
mysql-community-release.noarch             el6-5                       installed
mysql-community-server.x86_64              5.6.35-2.el6                @mysql56-community
perl-DBD-MySQL.x86_64                      4.013-3.el6                 @base    
MySQL-python.x86_64                        1.2.3-0.3.c1.1.el6          base     
MySQL-zrm.noarch                           3.0-6.el6                   epel     
apr-util-mysql.x86_64                      1.3.9-3.el6_0.1             base     
asterisk-mysql.x86_64                      1.8.32.3-2.el6              epel     
bacula-director-mysql.x86_64               5.0.0-13.el6                base     
bacula-storage-mysql.x86_64                5.0.0-13.el6                base     
collectd-mysql.x86_64                      4.10.9-3.el6                epel     
dmlite-plugins-mysql.x86_64                0.8.5-1.el6                 epel     
dovecot-mysql.x86_64                       1:2.0.9-22.el6              base     
dpm-copy-server-mysql.x86_64               1.9.0-1.el6                 epel     
dpm-name-server-mysql.x86_64               1.9.0-1.el6                 epel     
dpm-server-mysql.x86_64                    1.9.0-1.el6                 epel     
dpm-srm-server-mysql.x86_64                1.9.0-1.el6                 epel     
dspam-mysql.x86_64                         3.10.2-7.el6                epel     
exim-mysql.x86_64                          4.88-2.el6                  epel     
freeradius-mysql.x86_64                    2.2.6-6.el6_7               base     
fts-mysql.i686                             3.5.7-1.el6                 epel     
fts-mysql.x86_64                           3.5.7-1.el6                 epel     
gnokii-smsd-mysql.x86_64                   0.6.30-2.el6                epel     
holland-mysql.noarch                       1.0.14-3.el6                epel     
holland-mysqldump.noarch                   1.0.14-3.el6                epel     
holland-mysqllvm.noarch                    1.0.14-3.el6                epel     
lfc-server-mysql.x86_64                    1.9.0-1.el6                 epel     
libdbi-dbd-mysql.x86_64                    0.8.3-5.1.el6               base     
libmysqlclient16.x86_64                    5.1.69-1.w6                 webtatic 
libmysqlclient16-devel.x86_64              5.1.69-1.w6                 webtatic 
libnss-mysql.i686                          1.5-12.el6                  epel     
libnss-mysql.x86_64                        1.5-12.el6                  epel     
libodb-mysql.i686                          2.3.0-1.el6                 epel     
libodb-mysql.x86_64                        2.3.0-1.el6                 epel     
libodb-mysql-devel.i686                    2.3.0-1.el6                 epel     
libodb-mysql-devel.x86_64                  2.3.0-1.el6                 epel     
lighttpd-mod_authn_mysql.x86_64            1.4.45-1.el6                epel     
lighttpd-mod_mysql_vhost.x86_64            1.4.45-1.el6                epel     
lua-sql-mysql.x86_64                       2.1.1-7.el6                 epel     
mod_auth_mysql.x86_64                      1:3.0.0-11.el6_0.1          base     
mydns-mysql.x86_64                         1.2.8.31-2.el6              epel     
mysql.x86_64                               5.1.73-8.el6_8              updates  
mysql++.i686                               3.0.9-3.el6                 epel     
mysql++.x86_64                             3.0.9-3.el6                 epel     
mysql++-devel.i686                         3.0.9-3.el6                 epel     
mysql++-devel.x86_64                       3.0.9-3.el6                 epel     
mysql++-manuals.x86_64                     3.0.9-3.el6                 epel     
mysql-bench.x86_64                         5.1.73-8.el6_8              updates  
mysql-community-bench.x86_64               5.6.35-2.el6                mysql56-community
mysql-community-client.i686                5.6.35-2.el6                mysql56-community
mysql-community-common.i686                5.6.35-2.el6                mysql56-community
mysql-community-devel.i686                 5.6.35-2.el6                mysql56-community
mysql-community-embedded.i686              5.6.35-2.el6                mysql56-community
mysql-community-embedded.x86_64            5.6.35-2.el6                mysql56-community
mysql-community-embedded-devel.i686        5.6.35-2.el6                mysql56-community
mysql-community-embedded-devel.x86_64      5.6.35-2.el6                mysql56-community
mysql-community-libs.i686                  5.6.35-2.el6                mysql56-community
mysql-community-libs-compat.i686           5.6.35-2.el6                mysql56-community
mysql-community-test.x86_64                5.6.35-2.el6                mysql56-community
mysql-connector-java.noarch                1:5.1.17-6.el6              base     
mysql-connector-odbc.x86_64                5.3.7-1.el6                 mysql-connectors-community
mysql-connector-odbc-debuginfo.x86_64      5.3.7-1.el6                 mysql-connectors-community
mysql-connector-odbc-setup.x86_64          5.3.7-1.el6                 mysql-connectors-community
mysql-connector-python.noarch              2.0.4-1.el6                 mysql-connectors-community
mysql-connector-python.x86_64              2.1.5-1.el6                 mysql-connectors-community
mysql-connector-python-cext.x86_64         2.1.5-1.el6                 mysql-connectors-community
mysql-connector-python-debuginfo.x86_64    2.1.5-1.el6                 mysql-connectors-community
mysql-devel.i686                           5.1.73-8.el6_8              updates  
mysql-devel.x86_64                         5.1.73-8.el6_8              updates  
mysql-embedded.i686                        5.1.73-8.el6_8              updates  
mysql-embedded.x86_64                      5.1.73-8.el6_8              updates  
mysql-embedded-devel.i686                  5.1.73-8.el6_8              updates  
mysql-embedded-devel.x86_64                5.1.73-8.el6_8              updates  
mysql-libs.i686                            5.1.73-8.el6_8              updates  
mysql-libs.x86_64                          5.1.73-8.el6_8              updates  
mysql-mmm.noarch                           2.2.1-2.el6                 epel     
mysql-mmm-agent.noarch                     2.2.1-2.el6                 epel     
mysql-mmm-monitor.noarch                   2.2.1-2.el6                 epel     
mysql-mmm-tools.noarch                     2.2.1-2.el6                 epel     
mysql-proxy.i686                           0.8.5-2.el6                 epel     
mysql-proxy.x86_64                         0.8.5-2.el6                 epel     
mysql-proxy-devel.i686                     0.8.5-2.el6                 epel     
mysql-proxy-devel.x86_64                   0.8.5-2.el6                 epel     
mysql-ref-manual-5.6-en-html-chapter.noarch
                                           1-20170110                  mysql56-community
mysql-ref-manual-5.6-en-pdf.noarch         1-20170110                  mysql56-community
mysql-router.x86_64                        2.0.4-1.el6                 mysql-tools-community
mysql-router-debuginfo.x86_64              2.0.4-1.el6                 mysql-tools-community
mysql-server.x86_64                        5.1.73-8.el6_8              updates  
mysql-test.x86_64                          5.1.73-8.el6_8              updates  
mysql-utilities.noarch                     1.6.5-1.el6                 mysql-tools-community
mysql-utilities-extra.noarch               1.5.6-1.el6                 mysql-tools-community
mysql-workbench-community.x86_64           6.3.8-1.el6                 mysql-tools-community
mysql-workbench-community-debuginfo.x86_64 6.3.8-1.el6                 mysql-tools-community
mysql55w.x86_64                            5.5.54-1.w6                 webtatic 
mysql55w-bench.x86_64                      5.5.54-1.w6                 webtatic 
mysql55w-devel.x86_64                      5.5.54-1.w6                 webtatic 
mysql55w-embedded.x86_64                   5.5.54-1.w6                 webtatic 
mysql55w-embedded-devel.x86_64             5.5.54-1.w6                 webtatic 
mysql55w-libs.x86_64                       5.5.54-1.w6                 webtatic 
mysql55w-server.x86_64                     5.5.54-1.w6                 webtatic 
mysql55w-test.x86_64                       5.5.54-1.w6                 webtatic 
mysqlreport.noarch                         3.5-4.el6                   epel     
mysqltuner.noarch                          1.6.0-1.el6                 epel     
nagios-plugins-mysql.x86_64                2.1.4-3.el6                 epel     
ndoutils-mysql.x86_64                      1.5.2-1.el6                 epel     
nodejs-mysql.noarch                        2.0.0-alpha9.2.el6.2        epel     
opendbx-mysql.x86_64                       1.4.6-6.el6                 epel     
openscada-DB-MySQL.x86_64                  0.7.2-1.el6                 epel     
opensips-mysql.x86_64                      1.7.2-2.el6                 epel     
pam_mysql.i686                             1:0.7-0.12.rc1.el6          epel     
pam_mysql.x86_64                           1:0.7-0.12.rc1.el6          epel     
pcp-pmda-mysql.x86_64                      3.10.9-6.el6                base     
pdns-backend-mysql.x86_64                  3.3.3-2.el6                 epel     
perl-Class-DBI-mysql.noarch                1.00-7.el6                  epel     
perl-DateTime-Format-MySQL.noarch          0.04-8.el6                  epel     
perl-Test-mysqld.noarch                    0.17-3.el6                  epel     
perl-Time-Piece-MySQL.noarch               0.05-8.el6                  epel     
php-ZendFramework-Db-Adapter-Mysqli.noarch 1.12.20-1.el6               epel     
php-ZendFramework-Db-Adapter-Pdo-Mysql.noarch
php-mysql.x86_64                           5.3.3-48.el6_8              updates  
php-pear-MDB2-Driver-mysql.noarch          1.5.0-0.8.b4.el6            epel     
php-pear-MDB2-Driver-mysqli.noarch         1.5.0-0.8.b4.el6            epel     
php55w-mysql.x86_64                        5.5.38-1.w6                 webtatic 
php55w-mysqlnd.x86_64                      5.5.38-1.w6                 webtatic 
php56w-mysql.x86_64                        5.6.30-1.w6                 webtatic 
php56w-mysqlnd.x86_64                      5.6.30-1.w6                 webtatic 
php70w-mysql.x86_64                        7.0.16-1.w6                 webtatic 
php70w-mysqlnd.x86_64                      7.0.16-1.w6                 webtatic 
php71w-mysql.x86_64                        7.1.2-1.w6                  webtatic 
php71w-mysqlnd.x86_64                      7.1.2-1.w6                  webtatic 
poco-mysql.i686                            1.4.2p1-3.el6               epel     
poco-mysql.x86_64                          1.4.2p1-3.el6               epel     
proftpd-mysql.x86_64                       1.3.3g-10.el6               epel     
qt-mysql.i686                              1:4.6.2-28.el6_5            base     
qt-mysql.x86_64                            1:4.6.2-28.el6_5            base     
qt3-MySQL.i686                             3.3.8b-30.el6               base     
qt3-MySQL.x86_64                           3.3.8b-30.el6               base     
qt5-qtbase-mysql.i686                      5.6.1-3.el6                 epel     
qt5-qtbase-mysql.x86_64                    5.6.1-3.el6                 epel     
rekall-mysql.i686                          2.4.6-13.el6                epel     
rekall-mysql.x86_64                        2.4.6-13.el6                epel     
root-sql-mysql.x86_64                      5.34.36-1.el6               epel     
rsyslog-mysql.x86_64                       5.8.10-10.el6_6             base     
rsyslog7-mysql.x86_64                      7.4.10-5.el6                base     
ruby-mysql.x86_64                          2.8.2-1.el6                 epel     
soci-mysql.i686                            3.2.2-2.el6                 epel     
soci-mysql.x86_64                          3.2.2-2.el6                 epel     
soci-mysql-devel.i686                      3.2.2-2.el6                 epel     
soci-mysql-devel.x86_64                    3.2.2-2.el6                 epel     
tcl-mysqltcl.x86_64                        3.052-1.el6                 epel     
trytond-mysql.noarch                       1.8.10-1.el6                epel     
voms-mysql-plugin.x86_64                   3.1.7-1.el6                 epel     
zabbix-proxy-mysql.x86_64                  1.8.22-1.el6                epel     
zabbix-server-mysql.x86_64                 1.8.22-1.el6                epel     
zabbix-web-mysql.noarch                    1.8.22-1.el6                epel     
zabbix20-proxy-mysql.x86_64                2.0.20-1.el6                epel     
zabbix20-server-mysql.x86_64               2.0.20-1.el6                epel     
zabbix20-web-mysql.noarch                  2.0.20-1.el6                epel     
zabbix22-dbfiles-mysql.noarch              2.2.16-1.el6                epel     
zabbix22-proxy-mysql.x86_64                2.2.16-1.el6                epel     
zabbix22-server-mysql.x86_64               2.2.16-1.el6                epel     
zabbix22-web-mysql.noarch                  2.2.16-1.el6                epel  

  只需要安装红色的字体的安装包即可,其他都是依赖库【包括mysql-client 客户端】

安装完成后,重启mysql

 命令:

service mysqld restart   或者 /etc/init.d/mysqld start 

有提示OK的字样说明安装成功:

Starting mysqld:                                           [  OK  ]

  如果你没有将原来的版本删除而直接更新,可能会提示Failed的提示,此时,只有一个方法:看日志,默认的日志路径:/var/log/mysqld.log

  

2017-03-17 16:27:44 8783 [Note] Plugin 'FEDERATED' is disabled.
2017-03-17 16:27:44 8783 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-03-17 16:27:44 8783 [Note] InnoDB: The InnoDB memory heap is disabled
2017-03-17 16:27:44 8783 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-03-17 16:27:44 8783 [Note] InnoDB: Memory barrier is not used
2017-03-17 16:27:44 8783 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-03-17 16:27:44 8783 [Note] InnoDB: Using Linux native AIO
2017-03-17 16:27:44 8783 [Note] InnoDB: Using CPU crc32 instructions
2017-03-17 16:27:44 8783 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-03-17 16:27:44 8783 [Note] InnoDB: Completed initialization of buffer pool
2017-03-17 16:27:44 8783 [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 768 pages, max 0 (relevant if non-zero) pages!
2017-03-17 16:27:44 8783 [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-03-17 16:27:44 8783 [ERROR] Plugin 'InnoDB' init function returned error.
2017-03-17 16:27:44 8783 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2017-03-17 16:27:44 8783 [ERROR] Unknown/unsupported storage engine: InnoDB
2017-03-17 16:27:44 8783 [ERROR] Aborting

2017-03-17 16:27:44 8783 [Note] Binlog end
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'partition'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'BLACKHOLE'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_DATAFILES'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_TABLESPACES'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN_COLS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_FOREIGN'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_FIELDS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_COLUMNS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_INDEXES'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_TABLESTATS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_SYS_TABLES'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_INDEX_TABLE'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_INDEX_CACHE'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_CONFIG'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_BEING_DELETED'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_DELETED'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_FT_DEFAULT_STOPWORD'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_METRICS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_BUFFER_POOL_STATS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE_LRU'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_BUFFER_PAGE'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX_RESET'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMPMEM'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_CMP'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_LOCKS'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'INNODB_TRX'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'ARCHIVE'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'PERFORMANCE_SCHEMA'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'MRG_MYISAM'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'MEMORY'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'MyISAM'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'CSV'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'sha256_password'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'mysql_old_password'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'mysql_native_password'
2017-03-17 16:27:44 8783 [Note] Shutting down plugin 'binlog'
2017-03-17 16:27:44 8783 [Note] /usr/sbin/mysqld: Shutdown complete

  注意红色字体的提示部分:

  解决方案:

  http://sharadchhetri.com/2014/11/29/upgrading-mysql-5-1-5-6-service-failed-start/

  在配置文件中[mysqldd]模块中添加:

   innodb_data_file_path = ibdata1:10M:autoextend

  问题原因:我推测可能是我没有卸载原来默认的mysql 5.1版本所导致的。

  

 至此,mysql的升级完成

【注意:在进行mysql升级之前,要做很多工作,升级完成或者升级失败,可能由于版本的原因,导致mysql一些原因,导致失败,所以,数据备份很重要的,很重要的。】

mysql的版本信息如下:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.35 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.

  Mysql5.6 社区版,至此安装成功

posted @ 2017-03-17 16:42  -起风了🪐  阅读(471)  评论(1编辑  收藏  举报