yum install the specified version mysql5.7

yum install the specified version mysql5.7

  • Installation dependent environment
# yum install -y yum-utils  wget
  • Download warehouse pack
# wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
  • Install warehouse pack
# rpm -ivh mysql80-community-release-el7-3.noarch.rpm
  • Update yum warehouse
# yum makecache
  • View available versions
# yum repolist all | grep mysql

The latest version is enabled by default and needs to be changed to the required version

Insert picture description here

  • Modify to the required version, that is, disable the unnecessary version of mysql in the yum repository and enable the required version
# yum-config-manager --disable mysql80-community
# yum-config-manager --enable mysql57-community
  • Check if the required version is enabled
# yum repolist all | grep mysql

Insert picture description here

  • Start installing mysql
# yum install mysql-community-server -y

Insert picture description here

  • Start mysql
# systemctl start mysqld
  • Version 5.7 mysql automatically generates a temporary password for the first time, it needs to be modified before it can be used normally
## 查看临时密码
# grep 'temporary password' /var/log/mysqld.log

## 登录mysql
# mysql -uroot -p

## 修改密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass0!';

mysql password-free login

  • Login without password

Modify my.cnf, find [mysqld], add skip-grant-tables or –skip-grant-tables below, restart mysql to log in without password

Published 141 original articles · Like 318 · Visit 270,000+

Guess you like

Origin blog.csdn.net/Sunny_Future/article/details/105345493