mysql 5.5升级5.6以上版本

来源:互联网 发布:sai mac没压感 编辑:程序博客网 时间:2024/06/11 02:00
1、下载yum的rpm配置
# rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm


2、编辑yum的repo文件配置
# vi  /etc/yum.repos.d/mysql-community.repo


1>打开文件后会有很多如下的mysql版本
2>需要安装哪个就设置 enabled=1 gpgcheck=1 
3>安装进入步骤3(推荐)
  升级进入步骤4(不建议升级、除非数据库太大不好迁移)


[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 


3、现在就可以通过yum安装mysql5.6或者其它版本了
# yum install mysqld -y
# yum install mysql-server -y


4、如果是升级mysql则
#yum update mysql-server
#yum list installed | grep "^mysql"


#yum -y upgrade mysql
#service mysqld start
#mysql_upgrade


如果启动服务出现什么莫名其妙的sock等等


#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


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


service mysqld restart