Using the system CentOS 6.2 was originally installed with MySQL 5.1, but 5.1 does not support the UTF8MB4 character set (see: http://blog.csdn.net/shootyou/article/details/8236024 ), you can only find ways to upgrade MySQL to 5.5.
This is an egg-ache upgrade process.
Complete steps:
1. Back up the data first, although the successful upgrade data will not be lost, but be on the safe side.
Mysqldump-u xxx-h xxx-p 3306-p--all-databases > Databases.sql
It is best to also back up a copy of the data files and configuration files.
Cp-r/data/mysql mysql-5.1-data cp/etc/my.cnf my.cnf-5.1
Stop the MySQL service after the backup is complete.
Service Mysqld Stop
Okay, get to the chase.
2. Uninstall the old version of MySQL
Yum Remove MySQL mysql-*
After the execution, we'll see if there's some mysql-libs or something.
Yum List Installed | grep MySQL
If you have one, you can delete it after you have verified it is useless.
Yum Remove Mysql-libs
Note that deleting mysql-libs may have an impact on some dependent software, which we will not discuss here.
OK, the unloading action is basically over.
3. Installing Mysql5.5
If you are not lazy, then choose to compile the installation may be better, you can refer to: http://my.oschina.net/laiwanshan/blog/72903
Here we discuss the process of using Yum installation.
After going over n detours, I found that I needed to install some new repo first.
RPM-UVH http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-2.noarch.rpm RPM-UVH/http mirrors.neusoft.edu.cn/epel/6/i386/epel-release-6-7.noarch.rpm RPM-UVH http://packages.sw.be/rpmforge-release/ rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm RPM-UVH http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/ epel-release-6-5.noarch.rpm RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
This time you run again:
Yum--enablerepo=remi,remi-test info MySQL mysql-server
You will find that the MySQL version is already 5.5.x. Do not hesitate to install it.
Yum--enablerepo=remi,remi-test install MySQL Mysql-server
Install to this end. Next is the launch and upgrade.
4. Launch and upgrade
This time you want to start straight out of ten times will be error, the main problem two block: One is the configuration file, 5.5 compared to 5.1 some configuration renamed, this requires you to control the startup error log a little bit of improvement. Second, there is no execution of Mysql_upgrade.
Run after you have ensured that the configuration file is not a problem:
Mysql_upgrade-u root-p
Wait for him all OK.
Try running MySQL again.
Service mysqld Start
Hope God bless what you see is green [OK].
If you need to upgrade MySQL from CentOS 5 then you can refer to: http://www.ha97.com/4145.html, but note that this only applies to CentOS 5, and I was misled by this for half a day at first.
Other references:
http://blog.iphoting.com/blog/2012/06/19/upgrading-to-mysql-5-dot-5-on-centos-6/
Http://stackoverflow.com/questions/9361720/update-mysql-version-from-5-1-to-5-5-in-centos-6-2