您好,欢迎访问一九零五行业门户网

CentOS 6.4源码编译安装MySQL5.6.17

首先查看系统版本平台: [root@localhost ~]# cat /etc/redhat-release centos release 6.4 (final) [root@localhost ~]# uname
首先查看系统版本平台:
[root@localhost ~]# cat /etc/redhat-release
centos release 6.4 (final)
[root@localhost ~]# uname -a
linux localhost.localdomain 2.6.32-358.el6.x86_64#1 smp fri feb 22 00:31:26 utc 2013 x86_64 x86_64 x86_64 gnu/linux
centos 6.2上源代码编译安装mysql-5.6.10以及mysql-5.5.34 
《mysql权威指南(原书第2版)》清晰中文扫描版 pdf
一、准备工作
1、添加epel源
[root@localhost ~]#
rpm -ivh
[root@localhost ~]# rpm --import/etc/pki/rpm-gpg/rpm-gpg-key-epel-6
2、安装yum加速组件:
[root@localhost ~]# yum install yum-plugin-fastestmirror -y
运行yum报错error: cannot retrieve metalink for repository: epel. please verifyits path and try agai
[root@localhost appstores]# yum installyum-plugin-fastestmirror -y
loaded plugins: fastestmirror, security
determining fastest mirrors
error: cannot retrieve metalink forrepository: epel. please verify its path and try again
解决办法:编译/etc/yum.repos.d/epel.repo,,做如下改动
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
——————————————————————————————
[root@localhost appstores]# yum installyum-plugin-fastestmirror -y
loaded plugins: fastestmirror, security
loading mirror speeds from cached hostfile
*base: mirrors.btte.net
*extras: mirrors.btte.net
*updates: mirrors.btte.net
epel/primary_db | 6.1 mb 00:34
extras | 3.4 kb 00:00
extras/primary_db | 19 kb 00:00
updates | 3.4 kb 00:00
updates/primary_db | 3.1 mb 00:22
setting up install process
resolving dependencies
--> running transaction check
---> packageyum-plugin-fastestmirror.noarch 0:1.1.30-14.el6 will be updated
---> packageyum-plugin-fastestmirror.noarch 0:1.1.30-17.el6_5 will be an update
--> finished dependency resolution
dependencies resolved
===========================================================================================
package arch version repository size
===========================================================================================
updating:
yum-plugin-fastestmirror noarch 1.1.30-17.el6_5 updates 28 k
transaction summary
===========================================================================================
upgrade 1 package(s)
total download size: 28 k
downloading packages:
yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch.rpm | 28 kb 00:00
warning: rpmts_hdrfromfdno: header v3rsa/sha1 signature, key id c105b9de: nokey
retrieving key from file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6
importing gpg key 0xc105b9de:
userid : centos-6 key (centos 6 officialsigning key)
package:centos-release-6-4.el6.centos.10.x86_64(@anaconda-centos-201303020151.x86_64/6.4)
from :/etc/pki/rpm-gpg/rpm-gpg-key-centos-6
running rpm_check_debug
running transaction test
transaction test succeeded
running transaction
warning: rpmdb altered outside of yum.
updating :yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch 1/2
cleanup :yum-plugin-fastestmirror-1.1.30-14.el6.noarch 2/2
verifying :yum-plugin-fastestmirror-1.1.30-17.el6_5.noarch 1/2
verifying :yum-plugin-fastestmirror-1.1.30-14.el6.noarch 2/2
updated:
yum-plugin-fastestmirror.noarch 0:1.1.30-17.el6_5
complete!
——————————————————————————————————————————————
3、准备编译mysql所需环境
[root@localhost ~]# yum -y install makegcc-c++ bison-devel ncurses-devel
4、编译安装cmake
[root@localhost ~]# wget
[root@localhost ~]# tar xfcmake-2.8.12.2.tar.gz
[root@localhost ~]# cd cmake-2.8.12.2
[root@localhost cmake-2.8.12.2]#./configure --prefix=/usr/local/cmake
[root@localhost cmake-2.8.12.2]# gmake
[root@localhost cmake-2.8.12.2]#makeinstall
5、为cmake增加环境变量
[root@localhost ~]# vim /etc/profile
[root@localhost ~]# source /etc/profile
[root@localhost ~]# tail -n2 /etc/profile
path=$path:/usr/local/cmake/bin
export path
5、准备mysql用户和组:
[root@localhost ~]# groupadd mysql&& useradd -s /sbin/nologin -g mysql -m mysql
[root@localhost ~]# grep mysql /etc/passwd/etc/group
/etc/passwd:mysql:x:500:500::/home/mysql:/sbin/nologin
6、创建mysql数据存放目录并授权:
[root@localhost ~]# mkdir/data/mysql56 -pv
mkdir: created directory `/data'
mkdir: created directory `/data/mysql56'
[root@localhost ~]# chown -r mysql.mysql/data/mysql56
[root@localhost ~]# ls -ld /data/mysql56
drwxr-xr-x. 2 mysql mysql 4096 may 21 00:38/data/mysql56
7、下载并解压mysql源码包
[root@localhost ~ ]# wget
[root@localhost ~ ]# tar xfmysql-5.6/mysql-5.6.17.tar.gz
更多详情见请继续阅读下一页的精彩内容:
其它类似信息

推荐信息