MySQL 5.7.19源码安装

环境:CentOS 5.6


su root

安装cmake

wget https://cmake.org/files/v3.9/cmake-3.9.1.tar.gz

tar -zxvf cmake-3.9.1.tar.gz

cd cmake-3.9.1

./configure --prefix=/usr/local/cmake

make

make install

echo  'CMAKE_HOME=/usr/local/cmake' >> ~/.bash_profile 

echo 'PATH=$PATH:$CMAKE_HOME/bin' >> ~/.bash_profile

echo 'export PATH' >> ~/.bash_profile

. ~/.bash_profile


安装mysql

groupadd mysql

useradd -r -g mysql -s /bin/false mysql

wget https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz

tar -zxvf mysql-5.7.19.tar.gz

cd mysql-5.7.19

mkdir bld

cd bld

cmake .. -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost_1_59_0

make

make install

cd /usr/local/mysql

chown -R mysql .

chgrp -R mysql .

bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql

bin/mysql_ssl_rsa_setup

chown -R root .

chown -R mysql /data/mysql



问题处理 (mysql安装时提示错误还是比较清楚的,直接按照提示执行就行)

问题:cmake安装时提示没有找到c++编译器

解决:yum install gcc-c++ 或者自行通过源码安装

问题:Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)

解决:yum install ncurses-devel

问题:2017-09-04 15:50:31 [ERROR]   Failed to access directory pointed by --datadir. Please make sure that directory exists and is accessible by mysql_ssl_rsa_setup. Supplied value : /var/lib/mysql

解决:

vi /etc/my.cnf 修改如下参数

datadir=/data/mysql

socket=/data/mysql/mysql.sock

log-error=/data/logs/mysql/mysqld.log

pid-file=/data/logs/mysql/mysqld.pid

你可能感兴趣的:(MYSQL,MySQL)