Monday, August 19, 2013

Installing MySQL 5.5 on CentOS 6.x

This post covers the installation of MySQL 5.5 on CentOS 6 (64bit)

By default, CentOS 6 ships with MySQL 5.1, but to take all the advantages of the more recent versions, it is generally recommended to try to use 5.5 or 5.6 if possible, especially on a new server.

0. Login as root/ su

1. Open Terminal Interface

2. Go to Temporary Folder

cd /tmp

3. Get and Install EPEL Repo  (this example uses 64bit, get the 32bit rpm if needed! )

wget http://fedora.mirror.nexicom.net/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm –Uvh epel-release-6-8.noarch.rpm


4. Get and Install REMI Repo
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm –Uvh remi-release-6.rpm

5. Check MySQL version to be installed
yum --enablerepo=remi list mysql mysql-server

**If the following error is observed during this step, see below for resolution

ERROR: Cannot retrieve metalink for repository: epel. Please verify its path and try again.

FIX: Edit epel.repo and change all https references in “mirrorlist” sections to http
cd /etc/yum.repos.d/
nano epel.repo
Find: mirrorlist=https://mirrors.fedorapro……
Change to: mirrorlist=http://mirrors.fedorapro…..


6. Install mysql 5.5
yum install --enablerepo=remi mysql mysql-server

7. Start MySQL and configure to start on boot
service mysqld start
chkconfig mysqld on


8. Run mysql upgrade script
mysql_upgrade -u root –p

9. Change Mysql default Password
/usr/bin/mysqladmin -u root password 'yourpasswordhere'

10. Check to ensure that the mysql is at the desired version
mysql –version

11. Set proper permissions on /tmpchown –R root:root /tmp
chmod –R 1777 /tmp


12. Secure MySQL
Optional but recommended for production servers
See link for details: http://dev.mysql.com/doc/refman/5.5/en/mysql-secure-installation.html

/usr/bin/mysql_secure_installation

13. Restart mysql service
service mysqld restart

That's it!

-noveck