[root@mysql1 ~]# whoami
root
[root@mysql1 ~]# uname -r
2.6.32-358.el6.x86_64
[root@mysql1 ~]# cat /etc/redhat-release
CentOS release 6.4 (Final)
[root@mysql1 ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:0D:D5:9F
inet addr:172.16.10.88 Bcast:172.16.255.255 Mask:255.255.0.0
inet6 addr: fe80::20c:29ff:fe0d:d59f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:506 errors:0 dropped:0 overruns:0 frame:0
TX packets:91 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:41642 (40.6 KiB) TX bytes:10715 (10.4 KiB)
1).添加一个虚拟用户 MySQL
[root@mysql1 ~]# useradd -r -s /sbin/nologin mysql
[root@mysql1 ~]# id mysql
uid=498(mysql) gid=498(mysql) groups=498(mysql)
[root@mysql1 ~]# tail -1 /etc/passwd
mysql:x:498:498::/home/mysql:/sbin/nologin
2).安装 openssl和openssl-devel 软件包
[root@mysql1 ~]# yum install openssl openssl-devel -y
3).安装ncurses-devel软件包
[root@mysql1 mysql-5.5.32]# yum install ncurses-devel -y
4).安装cmake-2.8.8编译工具 wget https://cmake.org/files/v2.8/cmake-2.8.0.tar.gz
[root@mysql1 tools]# ll
total 29580
-rw-r--r--. 1 root root 5691656 Jun 13 10:26 cmake-2.8.8.tar.gz #软件包
-rw-r--r--. 1 root root 24596474 Jun 13 10:10 mysql-5.5.32.tar.gz
[root@mysql1 tools]# tar xf cmake-2.8.8.tar.gz #解压软件
[root@mysql1 tools]# cd cmake-2.8.8 #切入到cmake-2.8.8目录里面
[root@mysql1 cmake-2.8.8]# pwd
/root/tools/cmake-2.8.8
[root@mysql1 cmake-2.8.8]# ./configure ./bootstrap #开始编译
[root@mysql1 cmake-2.8.8]# make && make install #编译并开始安装.....
5).开始安装MySQL数据库
[root@mysql1 tools]# pwd
/root/tools
[root@mysql1 tools]# tar xf mysql-5.5.32.tar.gz
[root@mysql1 tools]# ll
total 29588
drwxr-xr-x. 13 root root 4096 Jul 14 21:23 cmake-2.8.8
-rw-r--r--. 1 root root 5691656 Jun 13 10:26 cmake-2.8.8.tar.gz
drwxr-xr-x. 31 7161 wheel 4096 Jul 2 2013 mysql-5.5.32
-rw-r--r--. 1 root root 24596474 Jun 13 10:10 mysql-5.5.32.tar.gz
[root@mysql1 tools]# cd mysql-5.5.32
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \
-DMYSQL_DATADIR=/mydata/data \
-DSYSCONFDIR=/etc \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DWITH_READLINE=1 \
-DWITH_SSL=system \
-DWITH_ZLIB=system \
-DWITH_LIBWRAP=0 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci
[root@mysql1 mysql-5.5.32]# echo $?
0
[root@mysql1 mysql-5.5.32]# make && make install #开始编译 并安装