Skip to content
Home » MySQL » How to Install Newest MySQL on CentOS 6 from Official Repository

How to Install Newest MySQL on CentOS 6 from Official Repository

If you plan to install the newest MySQL on CentOS 7, you may refer to another post below: How to Install Newest LAMP on CentOS 7 Minimal (1/3) - MySQL

First of all, we should install a specific Yum repository from MySQL website:

[root@example ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@example ~]# rpm -Uvh https://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Retrieving https://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
Preparing...                ########################################### [100%]
   1:mysql-community-release########################################### [100%]
[root@example ~]# rpm -q mysql-community-release
mysql-community-release-el6-5.noarch

For other Linux distros or releases, please refer to https://dev.mysql.com/downloads/

Next, we can check the result by listing all enabled repos.

[root@example ~]# yum repolist
...
repo id                    repo name                                      status
...
mysql-connectors-community MySQL Connectors Community                          5
mysql-tools-community      MySQL Tools Community                               5
mysql56-community          MySQL 5.6 Community Server                         31
...

Let's install mysql-community-server.

[root@example ~]# yum install mysql-community-server
...

Let's see what RPMs that we have installed.

[root@example ~]# rpm -qa | grep mysql
mysql-community-release-el6-5.noarch
mysql-community-common-5.6.16-1.el6.x86_64
mysql-community-libs-compat-5.6.16-1.el6.x86_64
mysql-community-server-5.6.16-1.el6.x86_64
mysql-community-libs-5.6.16-1.el6.x86_64
mysql-community-client-5.6.16-1.el6.x86_64

Make it run automatically after reboots.

[root@example ~]# chkconfig mysqld on
[root@example ~]# chkconfig --list mysqld
mysqld          0:off   1:off   2:on    3:on    4:on    5:on    6:off

First time to start mysqld.

[root@example ~]# service mysqld start
...
                                                           [  OK  ]
Starting mysqld:                                           [  OK  ]

If you saw an error MySQL Daemon failed to start. when starting the service, you may refer to this post: How to Resolve "MySQL Daemon failed to start." on Linux.

Further reading: How to Install Newest LAMP on CentOS 7 Minimal (1/3) - MySQL.

Leave a Reply

Your email address will not be published. Required fields are marked *