Using the system CentOS 6.6 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.
Install the following method to install successfully.
Complete steps:
1. Back up the data first, although the successful upgrade data will not be lost, but be on the safe side.
[SQL]View Plaincopyprint?
- 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.
[SQL]View Plaincopyprint?
- 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.
[SQL]View Plaincopyprint?
- Service Mysqld Stop
Okay, get to the chase.
2. Uninstall the old version of MySQL
[SQL]View Plaincopyprint?
- Yum Remove MySQL mysql-*
After the execution, we'll see if there's some mysql-libs or something.
[SQL]View Plaincopyprint?
- Yum List Installed | grep MySQL
If you have one, you can delete it after you have verified it is useless.
[SQL]View Plaincopyprint?
- 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.
[SQL]View Plaincopyprint?
- RPM-UVH http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
- RPM-UVH http://mirrors.neusoft.edu.cn/epel/6/i386/epel-release-6-8.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:
[SQL]View Plaincopyprint?
- 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.
[SQL]View Plaincopyprint?
- 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:
After the installation in the test environment is able to start smoothly, so follow the installation of the CentOS install amp in the MySQL installation section to set the corresponding.
[SQL]View Plaincopyprint
- Mysql_upgrade-u root-p
Wait for him all OK.
Try running MySQL again.
[SQL]View Plaincopyprint?
- 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
centos6.6 installation MySQL5.5