centos6.6 installation MySQL5.5

Source: Internet
Author: User
Tags mysql version

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?
    1. 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?
    1. Cp-r/data/mysql Mysql-5.1-data
    2. CP/ETC/MY.CNF my.cnf-5.1

Stop the MySQL service after the backup is complete.

[SQL]View Plaincopyprint?
    1. Service Mysqld Stop

Okay, get to the chase.

2. Uninstall the old version of MySQL

[SQL]View Plaincopyprint?
    1. Yum Remove MySQL mysql-*

After the execution, we'll see if there's some mysql-libs or something.

[SQL]View Plaincopyprint?
    1. Yum List Installed | grep MySQL

If you have one, you can delete it after you have verified it is useless.

[SQL]View Plaincopyprint?
    1. 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?
    1. RPM-UVH http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    2. RPM-UVH http://mirrors.neusoft.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm
    3. RPM-UVH http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
    4. RPM-UVH http://dl.iuscommunity.org/pub/ius/stable/Redhat/6/x86_64/epel-release-6-5.noarch.rpm
    5. RPM-UVH http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

This time you run again:

[SQL]View Plaincopyprint?
    1. 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?
    1. 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
    1. Mysql_upgrade-u root-p

Wait for him all OK.

Try running MySQL again.

[SQL]View Plaincopyprint?
    1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.