简体   繁体   中英

Best way to install MySQL 5.6 on Centos 6.4

I just installed Centos 6.4, and installed MySQL using the version that came with the Centos distribution. To my dismay, it is MySQL 5.1.69 versus the current 5.6.12. As stated on http://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html , "the MySQL version will often be some way behind the currently available release", but I didn't expect that long.

[root@centosBox ~]# rpm -qa | grep mysql
mysql-5.1.69-1.el6_4.x86_64
mysql-devel-5.1.69-1.el6_4.x86_64
mysql-server-5.1.69-1.el6_4.x86_64
mysql-libs-5.1.69-1.el6_4.x86_64
[root@centosBox ~]# whereis mysql
mysql: /usr/bin/mysql /usr/lib64/mysql /usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz
[root@centosBox ~]# 

An alternative is to install by RPM packages which is the "recommended way to install MySQL" per http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html . I have done so and it wasn't overly complicated, however, I am concerned as I've often been told that I should always install by yum when available. Towards the very end of the documentation, it does describe doing so extremely briefly using yum, however, it is so brief that I question whether it is the way to go.

So.... What is the best way for a not guru Linux user to install/upgrade MySQL on a Centos machine?

Just this week (2013-10-28), MySQL announced official yum repositories for MySQL Community Edition. The packages are intended for use with RHEL-compatible Linux (eg CentOS).

All the details including how to set up the yum repo on your system, can be found from the announcement:

http://insidemysql.com/announcing-new-yum-repositories-for-mysql/

A bit off-topic but there we go.

It is recommended to install from the repositories because you can later update your software to a newer version with a simple yum upgrade . The repository takes care of that for you, as well as any dependencies the software may entertain with other libraries.

RPM Packages installed manually (even with yum , which then only acts as an installer) will have to be managed manually as well.

Since the MySQL RPM package shows no dependencies (as far as I can tell from the manual), you are safe from this side.

And to answer your question: the best method is to stick with the versions from the repository. If you need a newer version, then you took the right path.

I am no guru myself but I was happy with the result of the RPM method you mentioned since other times I have seen problems with mysql-libs being a dependency for other packages.

(depending on the 5.6 version you want and cpu)

mkdir MySQL
cd MySQL
wget http://dev.mysql.com/get/Downloads/MySQL-5.6/MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
tar -xvf MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
yum install MySQL*rpm

installs them in the correct order and removes mysql-libs in one step without conflicts.

http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html

It doesn't surprise me that MySQL is a bit behind. Why would Oracle make it easy for you to not use pay-for Oracle? </rant>

Anyway, you can get the awkwardly named, but otherwise identical MariaDB to run easily by adding a new YUM repository.

您可以从IUS存储库安装MySQL 5.5(mysql55-server.x86_64)(目前版本为5.5.34)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM