Original Centos7 configuring MySQL from zero compilation

Source: Internet
Author: User
Tags configuration php

Preface

It's a tough time to play. In addition to the compiler using Yum installation, all others are compiled manually. Hum ~

Seemingly on Nginx, PHP, MySQL three east, but they are too much to rely on others.

There is no way to use them to be honest with them to provide the things they want.

Some of the first modules depend on some Lib libraries,

If you are lazy, just follow the instructions below and enter them separately. Then look directly at the configuration chapter. (But this is not the latest version of the installation of Yo)

Directory

First, Centos7 from the zero compiler configuration Nginx

Second, Centos7 from the zero compiler configuration PHP

Iii. Centos7 Configuring MySQL from zero compilation

First, the preparatory work

1.1 Installing or updating GCC gcc-c++

Because I installed the CentOS is absolutely pure drops. There's nothing. No more. The compiler must be installed first.

# yum Install gcc gcc-c++

1.2 Creating a directory to use

Source is the folder used to store the source code. The package is used to store the compiled library files. Lnmp is what we really need to put inside. (nginx+mysql+memcached+php)

mkdir /source/
mkdir /package/
mkdir /lnmp/

 

Second, install MySQL article

2.1 Installing CMake

[Official website] https://cmake.org/

Command flow:

/source/
wget https://cmake.org/files/v3.8/cmake-3.8.2.tar.gz Tar CD Make Make install# export path=/package/cmake/bin: $PATH //SET environment variable. Can be ignored, just for your later use CMake convenient point.

2.2 Installing ncurses

[Official website] http://ftp.gnu.org/gnu/ncurses/

Command flow:

CD /source/
wget http://ftp.gnu.org/gnu/ncurses/ncurses-6.0.tar.gz tar -zxvf ncurses-6.0CD ncurses-6.0#. /Make makeInstall

2.3 Installing MySQL

[Official website] http://www.mysql.com/

Command flow:

Without boost mounting mode

//This is the MySQL source without the boost version. You can use the following parameters to automatically download boost during compilation//-ddownload_boost=1-dwith_boost=/package/boost
# cd/source/# wget http: //cdn.mysql.com/downloads/mysql-5.7/mysql-5.7.18.tar.gz# TAR-ZXVF mysql-5.7. -. tar.gz# CD MySQL-5.7. -# CMake.-dcmake_install_prefix=/usr/local/MySQL #-ddownload_boost=1-dwith_boost=/package/boost \//set up the auto-download boost library and put it in the path specified by-dwith_boost. #-DCURSES_LIBRARY=/PACKAGE/NCURSES/LIB/LIBNCURSES.A \//ncurses Library LIBNCURSES.A#-dcurses_include_path=/package/ncurses/include//ncurses Library header file# Make && make install

 # cd /source/
# wget http://cdn.mysql.com/downloads/mysql-5.7/mysql-boost-5.7.18.tar.gz # tar -zxvf mysql-boost-5.7 . Span style= "color: #800080;" >18 .tar.gz# cd mysql -5.7 . 18 # cmake . -dcmake_install_prefix=/usr/local/mysql -dwith_boost=boost/boost_1_59_0- Dcurses_library=/package/ncurese/lib/libncurses.a-dcurses_include_path=/package/ncurses/include# make &&

-dcmake_install_prefix//Mounting position

-dwith_boost Path to//boost library

-dcurses_library//ncurses Library LIBNCURSES.A

-dcurses_include_path//ncurses Library header file

Description: MySQL has been supported by the boost library since the 5.7 release. And it is very disgusting that MySQL needs to specify the boost version number, high or low, it is possible to cause the compilation does not pass.

To this, the use of CentOS7 on the most commonly used, the new Web module has been basically completed, the rest is to configure these software. Haha, in fact, the code is much, but the understanding is really quite simple, on those several commands. What do you think? Isn't that pretty simple.

Third, configure MySQL

3.1 Initializing the database

./mysqld--initialize-insecure--user=mysql--basedir=/lnmp/mysql--datadir=/lnmp/mysql/data

3.2 Start MySQL service and add boot MySQL service

Cp/lnmp/mysql/support-files/mysql.server/etc/init.d/mysql
Service MySQL Start

Execute command: ps-ef|grep mysql see MySQL service description started successfully

3.3 Modify the root password of MySQL, root initial password is empty

' Password '

Attached, commonly used commands

MySQL Common commands

#/lnmp/nginx/sbin/nginx             //start Nginx

Original Centos7 configuring MySQL from zero compilation

Related Article

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.