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

Some key points of website visual design

From handicraft design to graphic design to web de...

MySQL InnoDB MRR Optimization Guide

Preface MRR is the abbreviation of Multi-Range Re...

MySQL FAQ series: How to avoid a sudden increase in the size of the ibdata1 file

0. Introduction What is the ibdata1 file? ibdata1...

Nginx configuration and compatibility with HTTP implementation code analysis

Generate SSL Key and CSR file using OpenSSL To co...

HTML Tutorial: Definition List

<br />Original text: http://andymao.com/andy...

In-depth analysis of HTML table tags and related line break issues

What is a table? Table is an Html table, a carrie...

Instructions for using JSON operation functions in Mysql5.7

Preface JSON is a lightweight data exchange forma...

Analysis of the implementation process of three modes of VMWare network adapter

Three modes Bridged (bridge mode), NAT (network a...

What does the "a" in rgba mean? CSS RGBA Color Guide

RGBA is a CSS color that can set color value and ...

6 interesting tips for setting CSS background images

Background-image is probably one of those CSS pro...

Master the commonly used HTML tags for quoting content in web pages

Use blockquote for long citations, q for short ci...

Example code for implementing a QR code scanning box with CSS

We usually have a scanning box when we open the c...

Tomcat's class loading mechanism process and source code analysis

Table of contents Preface 1. Tomcat class loader ...

Tomcat first deployment web project process diagram

Put your own web project in the webapps directory...