ITPub博客

首页 > 数据库 > MySQL > yum mysql 5.1.73升级到5.6.26

yum mysql 5.1.73升级到5.6.26

原创 MySQL 作者:wzgchen 时间:2015-09-14 10:42:27 0 删除 编辑

Centos6.5
mysql 5.1.73

yum mysql 5.1.73升级到5.6.26


http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/




MySQL yum库包括最新的软件包有:
MySQL 5.6 (GA)
MySQL 5.7 (Development Release)
MySQL 5.5 (GA - Red Hat Enterprise Linux and Oracle Linux Only)
MySQL Workbench
MySQL Fabric
MySQL Utilities
MySQL Connector / ODBC
MySQL Connector / Python






RHEL7/CentOS7/Oracle linux7:
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
RHEL6/CentOS6/Oracle linux6:


RHEL6/CentOS6/Oracle linux6:
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
RHEL5/CentOS5/Oracle linux5:


RHEL5/CentOS5/Oracle linux5:
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el5-5.noarch.rpm




vi  /etc/yum.repos.d/mysql-community.repo
# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/5/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql 






yum repolist enabled | grep mysql


yum repolist all |grep mysql




Upgrading MySQL


yum update mysql-server
yum list installed | grep "^mysql"


yum -y upgrade mysql
service mysqld start
mysql_upgrade






yum install mysql-server
mysql> select version();
+-----------+
| version() |
+-----------+
| 5.1.73    |
+-----------+


[root@mysql1 mysql]# rpm -qa |grep mysql
mysql-community-release-el6-5.noarch
mysql-libs-5.1.73-5.el6_6.x86_64
mysql-server-5.1.73-5.el6_6.x86_64
mysql-5.1.73-5.el6_6.x86_64
mysql-devel-5.1.73-5.el6_6.x86_64






[root@mysql1 bin]# ll mysql*
-rwxr-xr-x. 1 root root  338792 Jun 22 21:08 mysql
-rwxr-xr-x. 1 root root  111560 Jun 22 21:07 mysqlaccess
-rwxr-xr-x. 1 root root   32384 Jun 22 21:08 mysqladmin
-rwxr-xr-x. 1 root root  145120 Jun 22 21:08 mysqlbinlog
-rwxr-xr-x. 1 root root    4808 Jun 22 21:08 mysqlbug
-rwxr-xr-x. 1 root root   28592 Jun 22 21:08 mysqlcheck
-rwxr-xr-x. 1 root root    4808 Jun 22 21:08 mysql_config
-rwxr-xr-x. 1 root root    4245 Jun 22 21:07 mysql_convert_table_format
-rwxr-xr-x. 1 root root   24495 Jun 22 21:07 mysqld_multi
-rwxr-xr-x. 1 root root   18204 Jun 22 21:07 mysqld_safe
-rwxr-xr-x. 1 root root   87048 Jun 22 21:08 mysqldump
-rwxr-xr-x. 1 root root    7402 Jun 22 21:07 mysqldumpslow
-rwxr-xr-x. 1 root root    3315 Jun 22 21:07 mysql_find_rows
-rwxr-xr-x. 1 root root    1261 Jun 22 21:07 mysql_fix_extensions
-rwxr-xr-x. 1 root root    5834 Jun 22 21:07 mysql_fix_privilege_tables
-rwxr-xr-x. 1 root root   32477 Jun 22 21:07 mysqlhotcopy
-rwxr-xr-x. 1 root root   24808 Jun 22 21:08 mysqlimport
-rwxr-xr-x. 1 root root   14646 Jun 22 21:07 mysql_install_db
-rwxr-xr-x. 1 root root    8198 Jun 22 21:07 mysql_secure_installation
-rwxr-xr-x. 1 root root   17473 Jun 22 21:07 mysql_setpermission
-rwxr-xr-x. 1 root root   24440 Jun 22 21:08 mysqlshow
-rwxr-xr-x. 1 root root   42168 Jun 22 21:08 mysqlslap
-rwxr-xr-x. 1 root root  187672 Jun 22 21:08 mysqltest
-rwxr-xr-x. 1 root root 1357920 Jun 22 21:08 mysql_tzinfo_to_sql
-rwxr-xr-x. 1 root root   68176 Jun 22 21:08 mysql_upgrade
-rwxr-xr-x. 1 root root  171288 Jun 22 21:08 mysql_waitpid
-rwxr-xr-x. 1 root root    3888 Jun 22 21:07 mysql_zap


cd /usr/bin/
cp mysql* oldmysql/
cp my.cnf my.cnf.5.1




cd /usr/share/mysql


[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid








[root@mysql1 yum.repos.d]# rpm -qa |grep mysql
mysql-community-release-el6-5.noarch
mysql-community-devel-5.6.26-2.el6.x86_64
mysql-community-common-5.6.26-2.el6.x86_64
mysql-community-server-5.6.26-2.el6.x86_64
mysql-community-client-5.6.26-2.el6.x86_64
mysql-community-libs-5.6.26-2.el6.x86_64




service mysqld start


vi /var/log/mysqld.log
2015-09-14 18:05:02 3395 [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!
2015-09-14 18:05:02 3395 [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!
2015-09-14 18:05:02 3395 [ERROR] Plugin 'InnoDB' init function returned error.
2015-09-14 18:05:02 3395 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2015-09-14 18:05:02 3395 [ERROR] Unknown/unsupported storage engine: InnoDB
2015-09-14 18:05:02 3395 [ERROR] Aborting


http://blog.csdn.net/hw_libo/article/details/39215723




原来的ibdata1大小:640*16/1024=10m
当前的ibdata1大小:768*16/1024=12m




[root@mysql1 mysql]# ll -h
total 21M
-rw-rw----. 1 mysql mysql  10M Sep 14 17:51 ibdata1
-rw-rw----. 1 mysql mysql 5.0M Sep 14 17:51 ib_logfile0
-rw-rw----. 1 mysql mysql 5.0M Sep 14 17:49 ib_logfile1
drwx------. 2 mysql mysql 4.0K Sep 14 17:49 mysql
drwx------. 2 mysql mysql 4.0K Sep 14 17:49 test


vi my.cnf
innodb_data_file_path = ibdata1:10m:autoextend


service mysqld restart




[root@mysql1 mysql]# ll -h
total 171M
-rw-rw----. 1 mysql mysql   56 Sep 14 18:36 auto.cnf
-rw-rw----. 1 mysql mysql  74M Sep 14 18:36 ibdata1
-rw-rw----. 1 mysql mysql  48M Sep 14 18:36 ib_logfile0
-rw-rw----. 1 mysql mysql  48M Sep 14 18:36 ib_logfile1
drwx------. 2 mysql mysql 4.0K Sep 14 17:49 mysql
srwxrwxrwx. 1 mysql mysql    0 Sep 14 18:36 mysql.sock
drwx------. 2 mysql mysql 4.0K Sep 14 17:49 test




mysql> select version();
+-----------+
| version() |
+-----------+
| 5.6.26    |
+-----------+


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/91975/viewspace-1798871/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2015-05-01

  • 博文量
    383
  • 访问量
    179196