Detailed process of building mysql5.7.29 on centos7 of linux

Detailed process of building mysql5.7.29 on centos7 of linux

1. Download MySQL

1.1 Download address

https://downloads.mysql.com/archives/community/

1.2 Version selection

2. Manage group and directory permissions

2.1 Unzip mysql

tar -zxf mysql-5.7.29-linux-glibc2.12-x86_64.tar.gz upload directory /home/tools

2.2 Rename

mv mysql-5.7.29-linux-glibc2.12-x86_64 mysql-5.7.29

2.3 Move the specified directory

mv mysql-5.7.29 /usr/local/

2.4 Add user groups and users

groupadd mysql

useradd -r -g mysql mysql

2.5 Modify directory permissions

chown -R mysql:mysql /usr/local/mysql-5.7.29/

3. Install MySQL

3.1 Configure MySQL service

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

3.2 Modify mysql service

vi /etc/init.d/mysql

3.3 Modify the configuration file my.cnf

vi /etc/my.cnf

The copied content is as follows, adjust the parameters as needed

[client]
port = 33066
default-character-set=utf8
[mysqld]
# General configuration options basedir = /usr/local/mysql-5.7.29
datadir = /usr/local/mysql-5.7.29/data
port = 33066
character-set-server=utf8
default_storage_engine = InnoDB
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZEO, NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

3.4 Initialize MySQL

/usr/local/mysql-5.7.29/bin/mysqld

--initialize--user=mysql

--basedir=/usr/local/mysql-5.7.29

--datadir=/usr/local/mysql-5.7.29/data

Success is as follows, please note the password

3.5 Start the service

service mysql start

4. Login and remote settings 4.1 Login to MySQL

./mysql -u root p Remember the registration password

4.2 Change the root login password

set password=password('new password');

4.3 Enable remote access

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password'; 
flush privileges;

5. Environment variables and startup configuration

5.1 Setting environment variables

vi /etc/profile

Add the following content

#mysql environment 
export MYSQL_HOME=/usr/local/mysql
export PATH=$PATH:$MYSQL_HOME/bin

source /etc/profile Update system variables

5.2 Startup

chkconfig --add mysql mysql service to the automatic service

chkconfig mysql on Set automatic startup

chkconfig --list View the service list

Summarize

This is the end of this article about the detailed process of building mysql5.7.29 on centos7 in linux. For more relevant content about building mysql5.7.29 on centos7, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • MySql 8.0.16-win64 Installation Tutorial
  • mysql 5.7.20 win64 installation and configuration method
  • MySQL 5.7.29 + Win64 decompression version installation tutorial with pictures and text

<<:  Teach you how to build hive3.1.2 on Tencent Cloud

>>:  Example of Vue uploading files using formData format type

Recommend

JavaScript and JQuery Framework Basics Tutorial

Table of contents 1. JS Object DOM –1, Function –...

Solution to the failure of 6ull to load the Linux driver module

Table of contents 0x01 Failed to load the driver ...

HTML Several Special Dividing Line Effects

1. Basic lines 2. Special effects (the effects ar...

mysql 5.7.20 win64 installation and configuration method

mysql-5.7.20-winx64.zipInstallation package witho...

A brief discussion on Nginx10m+ high concurrency kernel optimization

What is high concurrency? The default Linux kerne...

Layui implements sample code for multi-condition query

I recently made a file system and found that ther...

Let's talk in depth about the principle and implementation of new in JS

Table of contents definition Constructor bodies a...

Two box models in web pages (W3C box model, IE box model)

There are two types of web page box models: 1: Sta...

Complete step record of Vue encapsulation of general table components

Table of contents Preface Why do we need to encap...

Vue simulates the shopping cart settlement function

This article example shares the specific code of ...

Vue+webrtc (Tencent Cloud) practice of implementing live broadcast function

Table of contents 1. Live broadcast effect 2. Ste...

Docker pull image and tag operation pull | tag

I re-read the source code of the Fabric project a...

The front-end page pop-up mask prohibits page scrolling

A problem that front-end developers often encount...