rpm -ivh http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-release-el6-5.noarch.rpm
	rm -rf /etc/yum.repos.d/mysql-community.repo
	rm -rf /etc/yum.repos.d/mysql-community-source.repo
	wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community.repo -O /etc/yum.repos.d/mysql-community.repo
	wget http://github.itzmx.com/1265578519/repo/master/CentOS/mysql-community-source.repo -O /etc/yum.repos.d/mysql-community-source.repo
	yum -y update
	yum -y install mysql mysql-server
	yum localinstall mysql-community-release-el6-5.noarch.rpm
	yum install mysql-community-server
	rm -rf /var/lib/mysql/ibdata1
	rm -rf /var/lib/mysql/ib_logfile0
	rm -rf /var/lib/mysql/ib_logfile1
	service mysqld restart
	chkconfig –level 2345 mysqld on
	 
	确认版本信息:
	[root@west195246 bin]# mysql -V
mysql  Ver 14.14 Distrib 5.6.20, for Linux (x86_64) using  EditLine wrapper
	最后请修改/etc/my.cnf为mysql5.6的版本,如果升级还是以前5.1的,不通用,可能会导致一些未知问题
官方文档:http://dev.mysql.com/doc/refman/ … efault-changes.html
	 
- 
				# For advice on how to change settings please see
			 
- 
				# http://dev.mysql.com/doc/refman/ … ation-defaults.html
			 
- 
				
			 
- 
				[mysqld]
			 
- 
				#
			 
- 
				# Remove leading # and set to the amount of RAM for the most important data
			 
- 
				# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
			 
- 
				innodb_buffer_pool_size = 8M
			 
- 
				#
			 
- 
				# Remove leading # to turn on a very important data integrity option: logging
			 
- 
				# changes to the binary log between backups.
			 
- 
				# log_bin
			 
- 
				#
			 
- 
				# Remove leading # to set options mainly useful for reporting servers.
			 
- 
				# The server defaults are faster for transactions and fast SELECTs.
			 
- 
				# Adjust sizes as needed, experiment to find the optimal values.
			 
- 
				join_buffer_size = 8M
			 
- 
				sort_buffer_size = 2M
			 
- 
				read_rnd_buffer_size = 2M
			 
- 
				datadir=/var/lib/mysql
			 
- 
				socket=/var/lib/mysql/mysql.sock
			 
- 
				log-bin
			 
- 
				skip-networking
			 
- 
				default-time-zone = ‘+8:00’
			 
- 
				performance_schema_max_table_instances=200
			 
- 
				table_definition_cache=200
			 
- 
				table_open_cache=128
			 
- 
				
			 
- 
				# Disabling symbolic-links is recommended to prevent assorted security risks
			 
- 
				symbolic-links=0
			 
- 
				
			 
- 
				# Recommended in standard MySQL setup
			 
- 
				sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
			 
- 
				
			 
- 
				[mysqld_safe]
			 
- 
				log-error=/var/log/mysqld.log
			 
- 
				pid-file=/var/run/mysqld/mysqld.pid
			
 
 
复制代码
 
| 
 
						 
					 
						1.增加配置项,重启
					 
  
  
[mysqld]
  
performance_schema=on
  
  
  
  
2.SSH运行命令升级
  
mysql_upgrade -uroot -p数据库密码
				
  | 
	 
	 
	参考小樱之数据库升级