Linux 在 Centos 6.4 上安装 MySQL 5.6 的最佳方式
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17138477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best way to install MySQL 5.6 on Centos 6.4
提问by user1032531
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.
我刚刚安装了 Centos 6.4,并使用 Centos 发行版附带的版本安装了 MySQL。令我沮丧的是,它是 MySQL 5.1.69 与当前的 5.6.12。如http://dev.mysql.com/doc/refman/5.5/en/linux-installation-native.html 所述,“MySQL 版本通常会落后于当前可用的版本”,但我没有期待那么久。
[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.
另一种方法是通过 RPM 包安装,这是每个http://dev.mysql.com/doc/refman/5.5/en/linux-installation-rpm.html的“推荐的 MySQL 安装方式” 。我已经这样做了,而且并不太复杂,但是,我很担心,因为经常有人告诉我,我应该在可用时始终由 yum 安装。在文档的最后,它确实描述了使用 yum 非常简短地这样做,但是,它是如此简短以至于我怀疑它是否是要走的路。
So.... What is the best way for a not guru Linux user to install/upgrade MySQL on a Centos machine?
那么.... 对于非 Linux 大师用户来说,在 Centos 机器上安装/升级 MySQL 的最佳方式是什么?
采纳答案by RandomSeed
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.
建议从存储库安装,因为您以后可以使用简单的yum upgrade
. 存储库会为您处理这些问题,以及软件可能与其他库产生的任何依赖关系。
RPM Packages installed manually (even with yum
, which then only acts as an installer) will have to be managed manually as well.
手动安装的 RPM 包(即使使用yum
,它只充当安装程序)也必须手动管理。
Since the MySQL RPM package shows no dependencies (as far as I can tell from the manual), you are safe from this side.
由于 MySQL RPM 包没有显示任何依赖项(据我从手册中得知),因此您在这方面是安全的。
And to answer your question: the best method is to stick with the versions from the repository. If you needa newer version, then you took the right path.
并回答您的问题:最好的方法是坚持使用存储库中的版本。如果您需要更新的版本,那么您就走对了路。
回答by PaulProgrammer
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>
MySQL有点落后我并不感到惊讶。为什么 Oracle 会让您轻松地不使用付费 Oracle?</rant>
Anyway, you can get the awkwardly named, but otherwise identical MariaDB to run easily by adding a new YUM repository.
无论如何,您可以通过添加新的 YUM 存储库来轻松运行名称笨拙但其他方面相同的MariaDB。
回答by witkacy26
You can install MySQL 5.5 (mysql55-server.x86_64) from IUS repository (currently version 5.5.34 available)
您可以从 IUS 存储库安装 MySQL 5.5 (mysql55-server.x86_64)(当前版本 5.5.34 可用)
回答by Bill Karwin
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 (e.g. CentOS).
就在本周(2013-10-28),MySQL 宣布了 MySQL 社区版的官方 yum 存储库。这些软件包旨在用于与 RHEL 兼容的 Linux(例如 CentOS)。
All the details including how to set up the yum repo on your system, can be found from the announcement:
所有详细信息,包括如何在您的系统上设置 yum 存储库,都可以从公告中找到:
http://insidemysql.com/announcing-new-yum-repositories-for-mysql/
http://insidemysql.com/annoucing-new-yum-repositories-for-mysql/
回答by Ryan
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.
我自己不是专家,但我对你提到的 RPM 方法的结果感到满意,因为其他时候我看到 mysql-libs 作为其他包的依赖项的问题。
(depending on the 5.6 version you want and cpu)
(取决于你想要的5.6版本和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.
以正确的顺序安装它们,并在没有冲突的情况下一步删除 mysql-libs。
http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html
http://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html