Home > Database > Mysql Tutorial > How to use yum to install Mysql5.7.19 on Centos7

How to use yum to install Mysql5.7.19 on Centos7

黄舟
Release: 2017-09-26 10:21:07
Original
1192 people have browsed it

This article mainly introduces the detailed steps of using yum to install Mysql5.7.19 on Centos7. The editor thinks it is quite good, so I will share it with you now and give it as a reference. Let’s follow the editor and take a look.

The yum source of Centos7 does not have mysql by default, because mysql has been replaced by mariaDB.

First we download the repo source of mysql. We can go to the mysql official website to find the latest repo source address

##Address:

https: //dev.mysql.com/downloads/repo/yum/


Start downloading the repo source under linux


//下载mysql rpm包
# wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

//安装mysql rpm包
# rpm -ivh mysql57-community-release-el7-11.noarch.rpm

//安装mysql
# yum install mysql-community-server
Copy after login

Required after successful installation Restart the mysql service.


# service mysqld restart
Copy after login

The newly installed Mysql5.7 will randomly generate a root password. We need to find this random password first, and then change the password. We can find random root password through grep command.


[root@local bin]# grep "password" /var/log/mysqld.log
2017-09-24T08:03:30.664086Z 1 [Note] A temporary password is generated for root@localhost: 8A3xwbk8_P1A
Copy after login

Use a random password to log in to mysql


[root@local bin]# mysql -uroot -p
Enter password:
Copy after login

Reset the root password after entering


mysql> SET password=PASSWORD("mysql123");
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
Copy after login

If there is the above error, it means that the password setting is too simple. Password setting rules are to contain numbers, uppercase and lowercase letters and strings.


Finally grant external network login permission, username is the username, password is the login password

##

mysql>grant all privileges on *.* to username@'%' identified by 'password';
Copy after login

The above is the detailed content of How to use yum to install Mysql5.7.19 on Centos7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template