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

SQL implementation of LeetCode (177. Nth highest salary)

[LeetCode] 177.Nth Highest Salary Write a SQL que...

Summary of CSS usage tips

Recently, I started upgrading my blog. In the proc...

How to understand Vue's simple state management store mode

Table of contents Overview 1. Define store.js 2. ...

Zabbix WEB monitoring implementation process diagram

Take zabbix's own WEB interface as an example...

Docker image access to local elasticsearch port operation

Using the image service deployed by docker stack,...

...

React Router V6 Updates

Table of contents ReactRouterV6 Changes 1. <Sw...

22 Vue optimization tips (project practical)

Table of contents Code Optimization Using key in ...

Three implementation methods of Mysql copy table and grant analysis

How to quickly copy a table First, create a table...

Uncommon but useful tags in Xhtml

Xhtml has many tags that are not commonly used but...

Javascript basics about built-in objects

Table of contents 1. Introduction to built-in obj...

JS implements simple calendar effect

This article shares the specific code of JS to ac...

CSS margin overlap and how to prevent it

The vertically adjacent edges of two or more bloc...