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

Summary of knowledge points on using calculated properties in Vue

Computed properties Sometimes we put too much log...

Solution to the cross-domain problem of SpringBoot and Vue interaction

Table of contents Browser Same Origin Policy 1. V...

5 solutions to CSS box collapse

First, what is box collapse? Elements that should...

MySQL 8.0.22 installation and configuration graphic tutorial

MySQL8.0.22 installation and configuration (super...

Implementation of MySQL Shell import_table data import

Table of contents 1. Introduction to import_table...

Ubuntu 18.04 disable/enable touchpad via command

In Ubuntu, you often encounter the situation wher...

jQuery implements employee management registration page

This article example shares the specific code of ...

CSS inheritance method

Given a div with the following background image: ...

MySQL installation diagram summary

MySQL 5.5 installation and configuration method g...

MySQL deep paging (how to quickly paginate tens of millions of data)

Table of contents Preface Case optimization summa...

Why are the pictures on mobile web apps not clear and very blurry?

Why? The simplest way to put it is that pixels are...

Solutions to browser interpretation differences in size and width and height in CSS

Let’s look at an example first Copy code The code ...

Perfect solution to MySQL common insufficient memory startup failure

1. If MySQL is not started successfully, check th...