Linux Mysql installation and Linux Mysql Installation
1. Preparation
Cmake-3.6.0.tar.gz
Bison-3.0.4.tar.gz
Mysql-5.7.13.tar.gz (http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.13.tar.gz)
2. Install cmake and bison
First, check whether cmake is installed.
# rpm -qa |grep cmake
# tar zxvf cmake-3.6.0.tar.gz# cd cmake-3.6.0# ./bootstrap# make && make install
# tar zxvf bison-3.0.4.tar.gz# cd bison-3.0.4# ./configure# make && make install
3. Install Mysql
[root@localhost src]# tar -zxvf mysql-5.7.13.tar.gz[root@localhost src]# cd mysql-5.7.13[root@localhost mysql-5.7.13]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=mysql.mysql -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 ...CMake Error at cmake/boost.cmake:81 (MESSAGE): You can download it with -DDOWNLOAD_BOOST=1 -DWITH_BOOST=<directory> This CMake script will look for boost in <directory>. If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80Call Stack (most recent call first): cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST) CMakeLists.txt:451 (INCLUDE)-- Configuring incomplete, errors occurred!
<======================================================== ==========================================
Solution:
(1) Add the following options during pre-Compilation: cmake-DDOWNLOAD_BOOST = 1-DWITH_BOOST =/usr/local/boost
(2) download a boost package, put it in the/usr/local/boost directory, and add the option-DWITH_BOOST =/usr/local/boost
========================================================== =========================================>
[root@localhost mysql-5.7.13]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=mysql.mysql -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
... CMake Error at cmake/readline. cmake: 64 (MESSAGE ):
Curses library not found. Please install appropriate package,
Remove CMakeCache.txt and rerun cmake. On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first ):
Cmake/readline. cmake: 107 (FIND_CURSES)
Cmake/readline. cmake: 181 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt: 479 (MYSQL_CHECK_EDITLINE)
-- Refreshing incomplete, errors occurred!
See also "/usr/local/src/mysql-5.7.13/CMakeFiles/CMakeOutput. log". See also "/usr/local/src/mysql-5.7.13/CMakeFiles/CMakeError. log ".
<======================================================== ==========================================
Solution:
(1) install ncurses-devel
yum -y install ncurses-devel
(2)delete cmakecache.txt
rm CMakeCache.txt
(3) re-run cmake
[root@localhost mysql-5.7.13]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=mysql.mysql -DDEFAULT_CHARSET=gbk -DDEFAULT_COLLATION=gbk_chinese_ci -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/data/mysqldb -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost
========================================================== =========================================>
[root@localhost mysql-5.7.13]# make
[root@localhost mysql-5.7.13]# make install