CentOS 7 system to compile and install the mysql5.7 tutorial _mysql

Source: Internet
Author: User

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

# CMake. -LH | More

If there is an error in the middle process, please remove CMakeCache.txt and recompile

RM-RF CMakeCache.txt

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.

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.