I. Installation agreement
MySQL Installation path:/usr/local/mysql
MySQL database path: /data/mysql
My configuration file path: /usr/local/mysql/my.cnf
Second, uninstall MARIADB
# Rpm-qa | grep mariadb
# rpm-e--nodeps mariadb-libs-5.5.37-1.el7_0.x86_64 Package name is the previous query learned
Third, create user groups, users
Add MySQL Groupgroupadd mysql
Add useruseradd -g mysql mysql -s /bin/false
#下载源码包
Download the latest version at the website below
Http://dev.mysql.com/downloads/mysql/5.7.html#downloads
http://download.savannah.gnu.org/releases/libunwind/
Https://github.com/gperftools/gperftools/releases
# cd/usr/local/src/#
wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.1.tar.gz #
wget http://gperftools.googlecode.com/files/gperftools-2.5.tar.gz
# wget http://dev.mysql.com/get/Downloads/ Mysql-5.7/mysql-5.7.x.tar.gz
Libunwind Installation
# tar ZXVF libunwind-1.1.tar.gz
# cd libunwind-1.1 #
./configure
# make
# make install
Gperftools Installation
# CD ...
# tar ZXVF gperftools-2.1.tar.gz
# cd gperftools-2.1 #
./configure
# make
# make install
# echo "/usr/local/lib" >/etc/ld.so.conf.d/usr_local_lib.conf
# ldconfig
MySQL Installation
# CD ...
# tar ZXVF mysql-5.7.x.tar.gz
# CD mysql-5.7.x
Use the following command to view compilation parameter descriptions before compiling
If there is an error in the middle process, please remove CMakeCache.txt and recompile
MYSQ Compilation Installation
# cmake-dcmake_install_prefix=/usr/local/mysql \
-dmysql_datadir=/data/mysql \
-dsysconfdir=/etc \
- Dextra_charsets=all \
-ddefault_charset=utf8 \
-ddefault_collation=utf8_general_ci \
-DWITH_INNOBASE_ storage_engine=1 \
-denabled_local_infile=1 \
-dmysql_unix_addr=/dev/shm/mysql.sock \
-DMYSQL_TCP_ port=3306 \
-dmysql_user=mysql \
-dwith_debug=0 \
-ddownload_boost=1 \
-dwith_boost=/usr/local /boost
# make
# make install
'
change Permissions '
# chmod 755/var/lib/mysql
# cd/usr/ Local/mysql
# chown-r Mysql:mysql.
Initializing MySQL
/usr/local/mysql/bin/mysqld--initialize--basedir=/usr/local/mysql--datadir=/data/mysql--user=mysql--explicit_ Defaults_for_timestamp=1
Creating a MySQL configuration file
# CP SUPPORT-FILES/MY-DEFAULT.CNF/USR/LOCAL/MYSQL/MY.CNF
Summarize
The above is the entire content of this article, I hope the content of this article for everyone's study or work can bring certain help, if you have questions you can message exchange.