Pre-compilation Installation Preparation
Os:centos 6.9
mysql:5.7.18
Download MySQL Source
Official Source: Mysql-boost MySQL
Sohu Source: Mysql-boost MySQL
Uninstall the original version before installing MySQL
Query the MySQL directory file to uninstall the original MySQL
# Rpm-qa | grep mysql
# Find/-name mysql
# Yum remove-y mysql-libs-5.1.73-3.el6_5.x86_64
Install the compilation environment
# yum-y Install make wget gcc-c++ cmake bison-devel ncurses-devel
Preconfiguration Setup
# Groupadd MySQL
# Useradd-r-G mysql-s/bin/false MySQL
Beginning of Source-build Specific instructions
# mkdir ~/mysql && cd ~/mysql
# Mkdir-p/data/mysql_data
# Wget-c https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.18.tar.gz
# TAR-ZXVF mysql-boost-5.7.18.tar.gz && cd mysql-5.7.18/
# cmake. \
-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/data/mysql_data \
-DSYSCONFDIR=/ETC \
-ddownload_boost=1 \
-dwith_boost=/usr/local/boost \
-dwith_archive_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_myisam_storage_engine=1 \
-dwith_innobase_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dwith_readline=1 \
-dmysql_unix_addr=/var/lib/mysql/mysql.sock \
-dmysql_tcp_port=3306 \
-denabled_local_infile=1 \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci
# Make
# Make Install
End of Source-build Specific instructions
Postinstallation Setup
# Cd/usr/local/mysql
# chown-r MySQL.
# chgrp-r MySQL.
Before MySQL 5.7.6
# bin/mysql_install_db--user=mysql
MySQL 5.7.6 and up
# Bin/mysqld--initialize--user=mysql
# Bin/mysql_ssl_rsa_setup
# chown-r root.
# chown-r Mysql/data
# bin/mysqld_safe--user=mysql &
Configure boot-up entry
# Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysql.server
# chmod +x/etc/init.d/mysql.server
# Chkconfig--add mysql.server
# Chkconfig mysql.server on
Configuration/etc/my.cnf is for reference only and can not be used as default.
Start MySQL
# Service Mysql.server start
Join the Boot boot entry
# Chkconfig--live mysql.server on
To see if the port is occupied
# NETSTAT-TULNP | grep 3306
View Database version
# Ln-s/usr/local/mysql/bin/mysql/usr/bin/
# MySQL--version
Log in to Database
# Mysql-u root-p
View Database
>show databases;
Reset password, where is the password set to? root?
>Set Password = password ('? root? ');
Exit database
>exit;
This article is from the "patience is a Virtue" blog, please be sure to keep this source http://1550349.blog.51cto.com/1540349/1932470
Install MySQL using standard source distribution