Linux uses yum method to install mysql5.7 version

First of all, you can go to http://dev.mysql.com/downloads/repo/yum/ to download the rpm package and update it, but I chose to use wget to
operate, if wget is not installed, please first installation

yum -y install wget

then

/** Download the mysql source installation package* /
wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm
/** Install mysql source*/
yum localinstall mysql57-community- release-el7-8.noarch.rpm
/* The above two steps are necessary, the following is to check whether the source is installed successfully /
yum repolist enabled | grep “mysql. -community. //The result after success is shown below

Insert picture description here
Note: This configuration can be modified through vim /etc/yum.repos.d/mysql-community.repo to install the version of mysql when used for yum

Insert picture description here
Adhesive

yum install mysql-community-server //Install the mysql service, here to see whether the network speed is fast or slow
systemctl start mysqld //After installation, start the mysql service
systemctl status mysqld //Check the mysqld service, if you see the activity status here running, it means that the
installation has been successful.
systemctl enable mysqld //set the boot to start
systemctl daemon-reload //reload the service //
mysql5.7 will generate a default password during installation. The file for viewing this password generally exists in/ grep'temporary
password' on var/log/mysqld.log /var/log/mysqld.log //View password

Insert picture description here

mysql -uroot -p //After entering the password, a black and white welcome screen will be displayed. At this point, mysql has been installed successfully.
//The mysql version of 5.7 uses a password mechanism. The default is medium, which requires the password to have uppercase letters and special characters. I will talk about how to change this below.
//First I have to change this temporary password, enter mysql and enter
set password for'root'@'localhost'=password('Mypass123456!');
show variables like'%password%' //View MySQL about password related Configuration

Insert picture description here
0 is LOW, 1 is MEDIUM, 2 is STRONG

Generally, I use
set global validate_password_policy=0; //Set the password policy level
set global validate_password_length=6; //Set the minimum password length

Of course, you can also find related items to set through the /etc/my.cnf configuration file.
Exit and restart the mysqld service.

systemctl restart mysqld and you're done

Reference:
YUM method to install mysql5.7 version

Guess you like

Origin blog.csdn.net/qq_33697094/article/details/110004209