One, add users and Groups
1. Enter Root:
Su
2. Add a group:
Groupadd MySQL
3. Add Users:
Useradd-r-G mysql-s/bin/false MySQL
Second, installation
1. First download the latest version of MySQL 5.7.14 on the MySQL website, go to http://dev.mysql.com/downloads/mysql/, select generic Linux under source code.
2. Unzip
tar zxvf mysql-5.7. . tar. gz
3. The tools required to install MySQL:
(1) CMake, a cross-platform installation (compilation) tool;
(2) gcc-c++, C + + compiler;
(3) Boost Library, C + + language standard library extension library ( there is likely to be a pit );
(4) Perl, a programming preamble;
(5) Bison, a parser generator;
(6) Git, version control tools;
(7) Curses, Graph function library.
Yum Install GCC perl-data-dumper bison git ncurses-devel
4. Enter the extracted mysql-5.7.14 directory, compile the source code and generate the makefile.
(1) If your system has the BOOST-1.59 library installed and the environment variable is set, then execute:
CMake.
(2) If your system has a boost-1.59 library installed, then execute:
CMake. -dwith_boost=Path of BOOST
(3) If your system does not have boost-1.59 installed, then execute:
CMake. ddownload_boost=1 -dwith_boost=/usr/local/boost
This statement will automatically download the boost-1.59 version and install it.
(4) If the system prompts could not find Curses (missing:curses_library Curses_include_path), stating that the values of the CMake parameters are incorrect, then you add two parameters to the above base:
-dcurses_library=/usr/lib/libncurses.so-dcurses_include_path=/usr/include
5. Compiling:
Make
6. Installation:
Make Install
MySQL will be installed in the/usr/local/mysql directory.
7. Enter the installation directory:
Cd/usr/local/mysql
8. Permission settings:
chown -R MySQL. chgrp -R MySQL.
9. Initialize the database:
Bin/mysqld--initialize--user=mysqlbin/mysql_ssl_rsa_setupchown -R root. chown -R mysql databin/mysqld_safe--user=mysql &
CentOS 7 Source code compilation install MySQL 5.7.14