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

Detailed steps of MySQL5.7.17 source code installation

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "the detailed steps of MySQL5.7.17 source code installation". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn the detailed steps of MySQL5.7.17 source installation.

One: operating system environment and directory structure

[mysql@oracle11gtest ~] $cat / etc/redhat-release

CentOS release 6.8 (Final)

[mysql@oracle11gtest] $df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/vda1 40G 21G 18G 55% /

Tmpfs 7.8G 68K 7.8G 1% / dev/shm

/ dev/vdb1 1008G 169G 789G 18% / alidata1

Two: download

Https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.17.tar.gz

Official installation documentation address

Http://dev.mysql.com/doc/refman/5.7/en/installing-source-distribution.html

Three: create a user:

[mysql@oracle11gtest] $df-h

Filesystem Size Used Avail Use% Mounted on

/ dev/vda1 40G 21G 18G 55% /

Tmpfs 7.8G 68K 7.8G 1% / dev/shm

/ dev/vdb1 1008G 169g 789G 18% / alidata1 because my test environment is on Aliyun, oracle was installed in the alidata1 directory, and mysql is still installed in this directory, so I need to set the group of mysql users to ointall in order to allow mysql users to read and write the alidata1 directory

Useradd-g oinstall mysql

After creation:

[mysql@oracle11gtest ~] $id

Uid=1201 (mysql) gid=1000 (oinstall) groups=1000 (oinstall)

Four: prepare to install components, some components may already exist in the operating system, just ignore it.

Yum install gcc gcc-c++-y

Yum install-y ncurses-devel.x86_64

Yum install-y cmake.x86_64

Yum install-y libaio.x86_64

Yum install-y bison.x86_64

Yum install-y gcc-c++.x86_64

Fifth: database catalogue planning

Mysql software directory: / usr/local/mysql

Mysql data directory: / alidata1/mysqldata/3306/data

Mysql log directory: / alidata1/mysqldata/3306

[mysql@oracle11gtest] $mkdir-p / alidata1/mysqldata/ {3306 / {data,tmp,binlog}, backup,scripts}

Six: decompression

[root@oracle11gtest mysqlsoftware] # tar-xzvf mysql-5.7.17.tar.gz

Seven: CMake

The purpose of entering the extracted software directory for CMake,CMake is to generate makefile files in preparation for further compilation.

Cmake. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql\

-DDEFAULT_CHARSET=utf8\

-DDEFAULT_COLLATION=utf8_general_ci\

-DENABLED_LOCAL_INFILE=ON\

-DWITH_INNOBASE_STORAGE_ENGINE=1\

-DWITH_FEDERATED_STORAGE_ENGINE=1\

-DWITH_BLACKHOLE_STORAGE_ENGINE=1\

-DWITHOUT_EXAMPLE_STORAGE_ENGINE=1\

-DWITH_PARTITION_STORAGE_ENGINE=1\

-DWITH_PERFSCHEMA_STORAGE_ENGINE=1\

-DCOMPILATION_COMMENT='Mysqlma'\

-DWITH_READLINE=ON\

-DSYSCONFDIR=/data/mysqldata/3306\

-DMYSQL_UNIX_ADDR=/data/mysqldata/3306/mysql.sock

Encountered an error report:

CMake Error at cmake/boost.cmake:81 (MESSAGE):

You can download it with-DDOWNLOAD_BOOST=1-DWITH_BOOST=

This CMake script will look for boost in. If it is not there

It will download and unpack it (in that directory) for you.

If you are inside a firewall, you may need to use an http proxy:

Export http_proxy= http://example.com:80

Call Stack (most recent call first):

Cmake/boost.cmake:238 (COULD_NOT_FIND_BOOST)

CMakeLists.txt:455 (INCLUDE)

Configuring incomplete, errors occurred!

See also "/ root/mysqlsoftware/mysql-5.7.17/CMakeFiles/CMakeOutput.log".

See also "/ root/mysqlsoftware/mysql-5.7.17/CMakeFiles/CMakeError.log".

For the solution, refer to my other blog post: http://blog.itpub.net/20893244/viewspace-2133137/

Re-execute CMake, and the following message indicates that the CMake has passed:

-- Configuring done

-- Generating done

-- Build files have been written to: / root/mysql-5.7.17

Eight: compile and install, it takes a long time to wait patiently

[root@oracle11gtest mysql-5.7.17] # make & make install

Nine: configure my.cnf parameter file

Create a my.cnf file under / etc/, add the following parameters, and configure other parameters as needed [client]

Port=3306

Socket=/alidata1/mysql5717/data/mysql.sock

[mysqld]

Port=3306

User=mysql

Socket=/alidata1/mysql5717/data/mysql.sock

Pid-file=/alidata1/mysql5717/data/mysql.pid

Basedir=/usr/local/mysql5717

Datadir=/alidata1/mysql5717/data/

Tmpdir=/alidata1/mysql5717/tmp

.

Ten: initialize the database

Execute:

. / mysqld-- initialize-- user=mysql-- basedir=/usr/local/mysql-- datadir=/alidata1/mysqldata/3306/data will prompt for a temporary password in the log file and record the password

2017-02-07T01:50:22.772693Z 1 [Note] A temporary password is generated for root@localhost: / sxS7/15q

Note: versions prior to 5.7.6 need to initialize with the following command

Mysql_install_db

Eleven: install ssl

Execute:

. / mysql_ssl_rsa_setup

Twelve: start the database

Mysqld_safe-- defaults-file=/data/mysqldata/3306/my.cnf &

At this point, I believe you have a deeper understanding of the "detailed steps of MySQL5.7.17 source installation". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Database

Wechat

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

12
Report