CentOS 7 Source code compilation install MySQL 5.7.14

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.