Installation tutorial of the latest stable version of MySQL 5.7.17 under Linux

Installation tutorial of the latest stable version of MySQL 5.7.17 under Linux

Install the latest stable version of MySQL on Linux through source code: mysql-5.7.17
In order to facilitate the installation process without being affected by boost dependencies, download the mysql-boost-5.7.17.tar.gz version directly from the official website. (Officially, boost is needed during compilation, but it is not actually used.)

Installation Directory:

Startup script: /etc/init.d/mysqld
Program root directory: /usr/local/mysql
Data directory: /data/mysql

Installation Process

1. Install dependencies

#yum install -y cmake gcc-c++* make ncurses-devel

2. Create mysql user

#groupadd mysql
#useradd -r -g mysql -s /bin/false mysql

3. Download mysql-boost-5.7.17.tar.gz and upload it to the server

#tar xzf mysql-5.7.17.tar.gz 
#cd mysql-5.7.17
#mkdir bld
#cd bld/
#cmake .. -DWITH_BOOST=../boost/ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql 

#Specifying the parameters here will reduce a lot of operations in the subsequent startup process#make
#make install
#Use the default configuration file#cd /usr/local/mysql/support-files
#cp my-default.cnf ../my.cnf

#An error occurred during compilation. Clear temporary files and recompile:
#make clean
#rm CMakeCache.txt

4. After installation, add the executable file path to the system environment variable:

Environment variables

#echo "export PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
#source /etc/profile

5. Initialize the database

#mkdir /data/mysql
#chown -R mysql.mysql /data/mysql
#mysqld --defaults-file=/usr/local/mysql/my.cnf --initialize --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/

After mysql5.7 is initialized, a password will be randomly generated and printed directly on the screen.

6. Start the replication startup script:

#cd /usr/local/mysql/support-files
#cp mysql.server /etc/init.d/mysql

Direct Start

#mysqld_safe --user=mysql &
or #/etc/init.d/mysqld start

After startup, call the security script to achieve: change the root password, delete the test library, and prohibit root remote login

#mysql_secure_installation

Partial configuration (not optimized)

[client]
port=3306
socket=/tmp/mysql.sock
character_set_client=utf8
[mysqld]
basedir = /usr/local/mysql
datadir = /data/mysql
port = 3306
socket = /tmp/mysql.sock
character-set-server = utf8
read_buffer_size=131072
#innodb
innodb_data_file_path=ibdata1:100M:autoextend
#binlog
server_id=1
log-bin=mysql-bin
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqldump]
quick
max_allowed_packet=32M
[mysql]
[myisamchk]

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Tutorial on installing mysql5.7.17 on windows10
  • MySQL 5.7.17 installation and configuration graphic tutorial
  • Detailed process of decompressing and installing mysql5.7.17 zip
  • MySQL 5.7.17 installation and use graphic tutorial
  • MySQL 5.7.17 installation and configuration tutorial under Linux (Ubuntu)
  • mysql5.7.17.msi installation graphic tutorial
  • Complete steps to install the latest mysql5.7.17 using rpm in Linux system
  • How to install MySQL 5.7.17 and set the encoding to utf8 in Windows
  • Deploy MySQL 5.7.17 binary installation and multi-instance configuration on CentOS 6.5
  • MySQL 5.7.17 installation and configuration graphic tutorial

<<:  What is Makefile in Linux? How does it work?

>>:  Steps for Vue to use Ref to get components across levels

Recommend

Summary of solutions to common Linux problems

1. Connect Centos7 under VMware and set a fixed I...

Building an image server with FastDFS under Linux

Table of contents Server Planning 1. Install syst...

How to use DQL commands to query data in MySQL

In this article, the blogger will take you to lea...

Two ways to correctly clean up mysql binlog logs

mysql correctly cleans up binlog logs Preface: Th...

Vue ElementUI implements asynchronous loading tree

This article example shares the specific code of ...

Solution to Ubuntu not being able to connect to the Internet

Problem description: I used a desktop computer an...

Several ways to clear arrays in Vue (summary)

Table of contents 1. Introduction 2. Several ways...

MySQL 8.0.25 installation and configuration tutorial under Linux

The latest tutorial for installing MySQL 8.0.25 o...

How to export mysql table structure to excel

The requirements are as follows Export the table ...

Sample code for programmatically processing CSS styles

Benefits of a programmatic approach 1. Global con...

Windows 2019 Activation Tutorial (Office2019)

A few days ago, I found that the official version...

Detailed explanation of the installation and use of Vue-Router

Table of contents Install Basic configuration of ...

About the problem of vertical centering of img and span in div

As shown below: XML/HTML CodeCopy content to clip...

Html/Css (the first must-read guide for beginners)

1. Understanding the meaning of web standards-Why...