Home >Database >Mysql Tutorial >How to use yum to install Mysql5.7.19 on Centos7
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///下载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-serverRequired after successful installation Restart the mysql service.
# service mysqld restartThe 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_P1AUse a random password to log in to mysql
[root@local bin]# mysql -uroot -p Enter password:Reset the root password after entering
mysql> SET password=PASSWORD("mysql123"); ERROR 1819 (HY000): Your password does not satisfy the current policy requirementsIf 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.
##
mysql>grant all privileges on *.* to username@'%' identified by 'password';
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!