Transfer from https://www.cnblogs.com/wsl222000/p/5445768.html
1. Installing the mysql-5.5 Yum source
RPM-IVH http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
To install MySQL5.6, you can install:
RPM-IVH http://repo.mysql.com/mysql-community-release-el6.rpm
The latest Yum source can be downloaded to Http://dev.mysql.com/downloads/repo/yum
2. Modify the installed Yum source
Edit/etc/yum.repos.d/mysql-community.repo file, change 5.5 to 1,5.6 enabled to 0
# Enable to use MySQL 5.5[mysql55-community]name=mysql 5.5 community serverbaseurl=http://repo.mysql.com/yum/ mysql-5.5-community/el/6/$basearch/enabled=1gpgcheck=1gpgkey=file:/etc/pki/rpm-gpg/rpm-gpg-key-mysql# Enable to Use MySQL 5.6[mysql56-community]name=mysql 5.6 Community serverbaseurl=http://repo.mysql.com/yum/ mysql-5.6-community/el/6/$basearch/enabled=0gpgcheck=1gpgkey=file:/etc/pki/rpm-gpg/rpm-gpg-key-mysql
3. Installing mysql-5.5
Yum install mysql-community-client mysql-community-devel mysql-community-server php-mysql
4. Adjust the configuration
Edit/etc/my.cnf File
Innodb_file_per_table=1 set InnoDB to stand-alone tablespace mode, each table in each database will generate a data directory innodb_buffer_pool_size= default value: 128M, set to the operating system memory 70%-80% Best
Service mysqld start MySQL
Chkconfig mysqld on set to boot
Mysqladmin-u root password ' root ' set password to root
CentOS 6.* install MySQL-5.5 via yum