Tutorial on installing mysql5.7.36 database in Linux environment

Tutorial on installing mysql5.7.36 database in Linux environment

Download address: https://dev.mysql.com/downloads/mysql/5.7.html#downloads

insert image description here

Upload to server

rz-be

Unzip the file

tar -xvf mysql-5.7.36-linux-glibc2.12-x86_64.tar.gz 

insert image description here

Move and rename it

mv mysql-5.7.36-linux-glibc2.12-x86_64 /usr/local/mysql

Create mysql user groups and users and modify permissions

groupadd mysql
useradd -r -g mysql mysql

If groupadd: group 'mysql' already exists appears, ignore it because you have installed mysql before, just skip it

Create a data directory and grant permissions

mkdir -p /data/mysql #Create directory chown mysql:mysql -R /data/mysql #Give permissions 

insert image description here

Configure my.cnf

vim /etc/my.cnf

The content is as follows

[mysqld]
bind-address=0.0.0.0
port=3306
user=mysql
basedir=/usr/local/mysql
datadir=/data/mysql
socket=/tmp/mysql.sock
log-error=/data/mysql/mysql.err
pid-file=/data/mysql/mysql.pid
#character config
character_set_server=utf8mb4
symbolic-links=0
explicit_defaults_for_timestamp=true
innodb_log_file_size = 512M
max_allowed_packet = 200M

insert image description here

After editing: wq! Save and exit

Initialize the database

Enter the mysql bin directory

cd /usr/local/mysql/bin/

initialization

./mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --user=mysql --initialize

View Password

cat /data/mysql/mysql.err 

insert image description here

Start mysql and change the root password

First place mysql.server in /etc/init.d/mysql

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

Start mysql and view the mysql process

service mysql start
 
ps -ef | grep mysql
 

insert image description here

This means that MySQL has been installed successfully. Next, change the password. First log in to MySQL. The previous one is randomly generated.

./mysql -u root -p #bin directory

Follow the next five steps and log in again.

SET PASSWORD = PASSWORD('123456');
ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;  
update user set host = '%' where user = 'root'; #Enable root to access from any host FLUSH PRIVILEGES;#Refresh

Connect to mysql visualization tool

insert image description here

Finish

This is the end of this article about the tutorial on installing mysql5.7.36 database in Linux environment. For more relevant content about installing mysql5.7.36 in Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the related articles below. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Introduction to the process of installing MySQL 8.0 in Linux environment
  • Detailed steps to install MySQL 8.0.27 in Linux 7.6 binary
  • Tutorial on installing MySQL under Linux
  • MySQL multi-instance deployment and installation guide under Linux
  • MySQL 8.0.25 installation and configuration tutorial under Linux
  • mysql8.0.23 linux (centos7) installation complete and detailed tutorial
  • Detailed tutorial on installing MySQL database in Linux environment
  • Detailed tutorial on installing mysql-8.0.20 under Linux
  • Linux system MySQL8.0.19 quick installation and configuration tutorial diagram
  • Tutorial on installing mysql8 on linux centos7
  • Install MySQL database in Linux environment

<<:  About browser compatibility issues encountered and solutions (recommended)

>>:  Detailed explanation of JSONObject usage

Recommend

MyBatis dynamic SQL comprehensive explanation

Table of contents Preface Dynamic SQL 1. Take a l...

A brief discussion on what situations in MySQL will cause index failure

Here are some tips from training institutions and...

MySQL index principle and query optimization detailed explanation

Table of contents 1. Introduction 1. What is an i...

WeChat applet selects the image control

This article example shares the specific code for...

Linux unlink function and how to delete files

1. unlink function For hard links, unlink is used...

MySQL Database Iron Laws (Summary)

Good database specifications help reduce the comp...

mysql5.7.21.zip installation tutorial

The detailed installation process of mysql5.7.21 ...

MySQL table addition, deletion, modification and query basic tutorial

1. Create insert into [table name] (field1, field...

Detailed steps to install MySQL 5.7 via YUM on CentOS7

1. Go to the location where you want to store the...

Basic usage details of Vue componentization

Table of contents 1. What is componentization? 2....

Analyze the difference between computed and watch in Vue

Table of contents 1. Introduction to computed 1.1...

In-depth analysis of Vue's responsive principle and bidirectional data

Understanding object.defineProperty to achieve re...

Solution to prevent caching in pages

Solution: Add the following code in <head>: ...

How to create a web wireframe using Photoshop

This post introduces a set of free Photoshop wire...

About VUE's compilation scope and slot scope slot issues

What are slots? The slot directive is v-slot, whi...