CentOS 6.5版本
Linux vitus.feng 2.6.32-642.11.1.el6.x86_64 #1 SMP Fri Nov 18 19:25:05 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
MysqL5.5版本
Server version: 5.5.54-log Source distribution
下载地址:https://dev.MysqL.com/get/Downloads/MysqL-5.5/MysqL-5.5.54.tar.gz
安装目录 /usr/local/MysqL
数据目录/usr/local/MysqL/data
总结:首次安装时去官网下载的源码包版本不对,导致后面安装报错毫无头绪
安装步骤:
1.准备工作
a.安装库
yum -y install gcc*
b.安装cmake编译工具
cd /usr/local/src
#下载cmake-2.8.7.tar.gz
wget http://............................(51cto或自行百度下载)
tar zxvf cmake-2.8.7.tar.gz
cd cmake-2.8.7
#安装cmake
./configure
make
make install
2. 官网下载 MysqL5.5版本 linux下源码包
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/MysqL -DMysqL_DATADIR=/MysqL/data -DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1
make
make install
cd /usr/local/MysqL
/usr/local/MysqL/scripts/MysqL_install_db --user=MysqL-datadir=/MysqL/data
#此处如不指定datadir,到启动时会报错
chown -R root .
chown -R MysqL data
cp support-files/my-medium.cnf /etc/my.cnf
# Next command is optional
chmod +x /etc/init.d/MysqLd
/etc/init.d/MysqLd start