Detailed Tutorial on Installing MySQL 5.7 on RedHat 6.5

Detailed Tutorial on Installing MySQL 5.7 on RedHat 6.5

RedHat6.5 installation MySQL5.7 tutorial sharing, for your reference, the specific content is as follows

Installation environment: RedHat6.5

Step 1: Download

Download MySQL 5.7: http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar

Step 2: Installation

Before installation, check whether MySQL is already installed on the server. If so, uninstall it:

[root@worker1 tmp]# rpm -qa|grep mysql
mysql-libs-5.1.71-1.el6.x86_64
[root@worker1 tmp]# rpm -e --nodeps mysql-libs-5.1.71-1.el6.x86_64 //Uninstall

Unzip the downloaded file:

[root@worker1 tmp]# tar -xf mysql-5.7.12-1.el6.x86_64.rpm-bundle.tar 

這里寫圖片描述

Install in order:

rpm -ivh mysql-community-common-5.7.12-1.el6.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.12-1.el6.x86_64.rpm
rpm -ivh mysql-community-devel-5.7.12-1.el6.x86_64.rpm
rpm -ivh mysql-community-client-5.7.12-1.el6.x86_64.rpm
rpm -ivh mysql-community-server-5.7.12-1.el6.x86_64.rpm

If nothing unexpected happens, MySQL should have been installed successfully.

Step 3: Environment variable settings

1. Start MySQL: service mysqld start

這里寫圖片描述

2. Log in: mysql -u root -p. The password for the first login is blank. Press Enter directly:

這里寫圖片描述

Why does this error occur? The reason is that there is no Password field in the mysql.user table in MySQL 5.7, so you need to log in in a secure way and then change the password.

The solution is as follows:

Modify the MySQL configuration file: vim /etc/my.cnf, add skip-grant-tables at the end of the file, save the file, restart the MySQL service: service mysqld restart, and then log in again.

這里寫圖片描述

3. Change the password. The user password is under the database named mysql:

Execute the following instructions in sequence:

mysql> use mysql
mysql> update user set password_expired='N' where user='root'; 
mysql> update user set authentication_string=password('123456') where user='root';
mysql> flush privileges;

1. Note: Be sure to remove the skip password detection content added to the my.cnf configuration file and restart the service;

這里寫圖片描述

other:

1. Encoding settings: vim /etc/my.cnf, add the encoding content default-character-set=utf8 to the end of the file

2. Allow remote access to MySQL:
Give any host access to data
mysql>grant all privileges on . to 'root'@'%'with grant option;
Will report an error: ERROR 1133 (42000): Can't find any matching row in the user table
In fact, it is normal if the root user already exists in the mysql.user table, or, add identified by 'password' to the end of this sentence. As the following command line
mysql>grant all privileges on . to 'root'@'%'identified by '123456' with grant option;

3. Change the password policy:

mysql> set global validate_password_length=0; --Change password lengthmysql> set global validate_password_policy=0; --Change password policy to LOW

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 via yum on redhat7
  • Detailed steps to install MySQL 5.7.10 on redhat7.1 (with pictures and text)
  • The whole process of installing MYSQL under redhat 5.4
  • Installation of apache+php+mysql+imap+ldap+jdk+tomcat under redhat
  • MySQL installation diagram MySQL graphic installation tutorial (detailed instructions)
  • MySQL 5.7.13 installation and configuration method graphic tutorial (linux)
  • Installation and configuration process of linux mysql5.6 version
  • Linux environment mysql5.7.12 installation tutorial
  • MySQL 5.7.13 installation tutorial under Linux environment
  • The most complete MySQL 5.7.13 installation and configuration method graphic tutorial (linux) highly recommended!

<<:  An enhanced screenshot and sharing tool for Linux: ScreenCloud

>>:  Specific steps for Vue browser to return monitoring

Recommend

A brief discussion on two current limiting methods in Nginx

The load is generally estimated during system des...

WeChat applet component development: Visual movie seat selection function

Table of contents 1. Introduction 1. Component da...

Details of various font formats in HTML web pages

This section starts with the details of text modi...

Nginx Layer 4 Load Balancing Configuration Guide

1. Introduction to Layer 4 Load Balancing What is...

How to display the border when td is empty

Previously, I summarized how to use CSS to achieve...

jQuery manipulates cookies

Copy code The code is as follows: jQuery.cookie =...

Detailed tutorial on deploying Hadoop cluster using Docker

Recently, I want to build a hadoop test cluster i...

How to use nginx to configure access to wgcloud

The nginx configuration is as follows: Such as ht...

Solutions to VMware workstation virtual machine compatibility issues

How to solve VMware workstation virtual machine c...

Summary of MySql index, lock, and transaction knowledge points

This article summarizes the knowledge points of M...

JS realizes the front-end paging effect

This article example shares the specific code of ...

A brief discussion on the implementation principle of Vue slot

Table of contents 1. Sample code 2. See the essen...

CSS3 realizes the graphic falling animation effect

See the effect first Implementation Code <div ...

Implementation of docker-compose deployment project based on MySQL8

1. First, create the corresponding folder accordi...