centos 6.7 mysql 5.6_CentOS 6.7 安装 MySQL 5.6 思路整理

源代码及兼容包

源代码包下载:官网 > Downloads > MySQL Community Edition (GPL) > MySQL Community Server (GPL) > Select Platform > Source Code > Generic Linux (Architecture Independent), Compressed TAR Archive (mysql-5.6.29.tar.gz) > Download] > No thanks, just start my download.

兼容包下载:官网 > Downloads > MySQL Community Edition (GPL) > MySQL Community Server (GPL) > Select Platform > Linux Generic > Linux - Generic (glibc 2.5) (x86, 32-bit), RPM Package Compatibility Libraries (MySQL-shared-compat-5.6.29-1.linux_glibc2.5.i386.rpm) > Download > No thanks, just start my download.

官网提供了一系列的兼容包(可在下载页面 Linux Generic 分支中查看),主要是为了解决新版本的 MySQL 向下兼容的问题,比如 MySQL-shared-compat-xxx.rpm 包是为了解决 mysql-libs 与新版 MySQL 冲突的问题。

以 CentOS 6.7 为例,mysql-libs 默认被其他一些软件所依赖,比如 postfix、 crontabs 等。一般,我们在安装前都先使用 rpm -qa | grep mysql 查看系统都已经安装了那些 MySQL 的软件。然后,对这些软件进行卸载后,再进行 MySQL 的安装。但是,当我们使用 yum uninstall mysql-libs 时,会被要求把所依赖的软件包(postfix、 crontabs)一起删除,这并不是我们希望的。因为我们不希望卸载这两款软件,而只是卸载 mysql-libs。

不卸载 mysql-libs,直接安装 MySQL 行不行?根据我的测试结果来看,是不行的。因为 mysql-libs 安装后,默认配置文件会存放在 /etc/my.conf。如果此时,我们把 MySQL 都安装完毕(假如安装目录为默认的 /usr/local/mysql),那么 MySQL 的配置文件会存放在 /etc/usr/local/mysql/my.cnf,根据 mysqld 服务器启动读取配置文件的顺序看(见下表),/etc/my.conf 将会是第一个读取的配置文件,很显然,这会直接影响到 MySQL 的启动和运行。

On Unix, Linux and OS X, MySQL programs read startup options from the following files, in the specified order (top files are read first, later files take precedence). 出处

MySQL 启动时,读取配置文件的顺序如下:

File Name

Purpose

/etc/my.cnf

Global options

/etc/mysql/my.cnf

Global options

SYSCONFDIR/my.cnf

Global options

$MYSQL_HOME/my.cnf

Server-specific options defaults-extra-file The file specified with --defaults-extra-file=file_nam

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值