Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

A simple tutorial for compiling and installing mysql 5.7.21 under centos7

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following mainly brings you a simple tutorial on source code compilation and installation of mysql 5.7.21 under centos7. I hope these contents can bring you practical use, which is also the main purpose of this article when I edit the simple tutorial of source code compilation and installation of mysql 5.7.21 under centos7. All right, don't talk too much nonsense, let's just read the following.

1) download the installation package. Version 5.7 requires downloading a Boost C++ 1.59.0 (slow download)

# cd / data/soft# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21.tar.gz# tar-xfzf mysql-5.7.21.tar.gz# wget http://sourceforge.net/projects/boost/files/boost/1.59.0/boost_1_59_0.tar.gz# tar-xfzf boost_1_59_0.tar.gz

2) install the dependency package:

# yum-y install gcc gcc-c++ ncurses ncurses-devel bison libgcrypt perl make cmake

3) set up users and authorize the permissions of installation directory and data directory. This step can be done after compilation.

# useradd-g mysql mysql-s / sbin/nologin

4) compile and install

# cmake-DCMAKE_BUILD_TYPE=RelWithDebInfo-DCMAKE_INSTALL_PREFIX=/usr/local/mysql-DMYSQL_UNIX_ADDR=/usr/local/mysql/mysql.sock-DDEFAULT_CHARSET=utf8-DDEFAULT_COLLATION=utf8_general_ci-DMYSQL_DATADIR=/usr/lcoal/mysql/data-DSYSCONFDIR=/etc/my.cnf-DWITH_MYISAM_STORAGE_ENGINE=1-DWITH_INNOBASE_STORAGE_ENGINE=1-DWITH_PARTITION_STORAGE_ENGINE=1-DENABLE_DEBUG_SYNC=0-DENABLED_LOCAL_INFILE=1-DENABLED_PROFILING=1-DMYSQL_TCP_PORT=3306-DWITH_DEBUG=0-DWITH _ SSL=yes-DDOWNLOAD_BOOST=1-DWITH_BOOST=/data/soft/boost_1_59_0# make & & make install# to create a mysql user (but cannot log in to the system using a mysql account) # useradd-g mysql mysql-s / sbin/nologin# chown-R mysql:mysql / usr/local/mysql# enter the installation path Execute the initialization configuration script, create the database and table that comes with the system # cd / usr/local/mysql/bin/#mysqld-- defaults-file=/etc/my.cnf-- initialize-- basedir=/usr/local/mysql-- datadir=/usr/local/mysql/data-- user=mysql# add services, and copy the service scripts to the init.d directory And set boot # cp / usr/local/mysql/support-files/mysql.server / etc/init.d/mysql# chkconfig-- add mysql# chkconfig mysql on#service mysql start

5) Open remote connection

# prompt for the password of the database root user. Enter the mysql console # mysql-uroot-p#use mysql;#GRANT ALL PRIVILEGES ON *. * TO 'root'@'%' IDENTIFIED BY' password' WITH GRANT OPTION

# FLUSH PRIVILEGES

For the above on the centos7 source code compilation and installation of mysql 5.7.21 simple tutorial, we do not find it very helpful. If you need to know more, please continue to follow our industry information. I'm sure you'll like it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report