日期:2014-05-16  浏览次数:20982 次

在原有3306端口mysqld服务的情况再搭建第二个3308端口的mysql实例
1 download the tar.gz
[root@472322 tmp]# wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://cdn.mysql.com/
--2013-09-11 22:04:52--  http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz/from/http://cdn.mysql.com/
Resolving dev.mysql.com... 137.254.60.11
Connecting to dev.mysql.com|137.254.60.11|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz [following]
--2013-09-11 22:04:52--  http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.13.tar.gz
Resolving cdn.mysql.com... 23.3.96.242, 23.3.96.235
Connecting to cdn.mysql.com|23.3.96.242|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 35951160 (34M) [application/x-tar-gz]
Saving to: 鈥渕ysql-5.6.13.tar.gz鈥

100%[=============================================================================================================================>] 35,951,160  1.57M/s   in 28s     

2013-09-11 22:05:21 (1.21 MB/s) - 鈥渕ysql-5.6.13.tar.gz鈥saved [35951160/35951160]


2 安装cmake软件包
yum install cmake


3 create account of mysql
groupadd mysql           
useradd -g mysql mysql           
autoreconf --force --install
libtoolize --automake --force
automake --force --add-missing

4  complie the sources
mkdir -p /data56m1/m1
tar -xvf mysql-5.6.13.tar.gz 

5 cmake
mkdir -p /usr/local/mysql56m1
mkdir -p /data56m1
 time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56m1 -DMYSQL_DATADIR=/data56m1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56m1/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
PS: 5.6.13源码安装是默认带federated引擎的,不过要生效,需要在my.cnf里面的mysqld选项里面加上启动参数federated。

[root@472322 mysql-5.6.13]#  time cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql56m1 -DMYSQL_DATADIR=/data56m1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR==/data56m1/mysql.sock -DMYSQL_USER=mysql -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
.........
-- Looking for sched_getcpu - found
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS - Success
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64
-- Performing Test HAVE_IB_GCC_ATOMIC_BUILTINS_64 - Success
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC
-- Performing Test HAVE_IB_ATOMIC_PTHREAD_T_GCC - Success
-- Looking for asprintf
-- Looking for asprintf - found
-- Check size of pthread_t
-- Check size of pthread_t - done
-- Using cmake version 2.6.4
-- Not building NDB
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Success
-- Library mysqlclient depends on OSLIBS -lpthread;m;rt;dl
-- Googlemock was not found. gtest-based unit tests will be disabled. You can run cmake . -DENABLE_DOWNLOADS=1 to automatically download and build required components from source.
-- If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://foo.bar.com:80
-- Library mysqlserver depends on OSLIBS -lpthread;m;rt;crypt;dl
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/mysql-5.6.13

real    0m24.507s
user    0m13.984s
sys     0m7.372s
[root@472322 mysql-5.6.13]# 


6 build the db directy
[root@47