CentOS 6.5下源码安装mysql 5.5

前端之家收集整理的这篇文章主要介绍了CentOS 6.5下源码安装mysql 5.5前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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.安装库

  1. yum -y install gcc*

b.安装cmake编译工具

  1. cd /usr/local/src

  2. #下载cmake-2.8.7.tar.gz

  3. wget http://............................(51cto或自行百度下载)

  4. tar zxvf cmake-2.8.7.tar.gz

  5. cd cmake-2.8.7

  6. #安装cmake

  7. ./configure

  8. make

  9. make install


2. 官网下载 MysqL5.5版本 linux下源码包

  1. groupadd MysqL

  2. useradd -g MysqL MysqL

  3. tar zxvf MysqL-5.5.54.tar.gz

  4. cd MysqL-5.5.54


  1. 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

  2. make

  3. make install

  4. cd /usr/local/MysqL

  5. chown -R MysqL:MysqL/usr/local/MysqL

  6. /usr/local/MysqL/scripts/MysqL_install_db --user=MysqL-datadir=/MysqL/data

  7. #此处如不指定datadir,到启动时会报错

  8. chown -R root .

  9. chown -R MysqL data

  10. cp support-files/my-medium.cnf /etc/my.cnf

  11. /usr/local/MysqL/bin/MysqLd_safe --user=MysqL &

  12. # Next command is optional

  13. cp support-files/MysqL.server /etc/init.d/MysqLd

  14. chmod +x /etc/init.d/MysqLd

  15. /etc/init.d/MysqLd start


安装完成,使用/usr/local/MysqL/bin/MysqL 登录测试

猜你在找的CentOS相关文章