There is no mysql by default in the yum source of Centos7, because mariaDB has been used instead of mysql. First, we download the mysql repo source. 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 //Download mysql rpm package# wget http://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm //Install mysql rpm package# rpm -ivh mysql57-community-release-el7-11.noarch.rpm //Install mysql # yum install mysql-community-server After successful installation, you need to restart the mysql service. # service mysqld restart When MySQL 5.7 is first installed, a root password will be randomly generated. We need to find this random password first and then change the new password. We can find the random root password through the 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 Login to mysql using a random password [root@local bin]# mysql -uroot -p Enter password: Reset the root password after logging in mysql> SET password = PASSWORD("mysql123"); ERROR 1819 (HY000): Your password does not satisfy the current policy requirements If the above error message appears, it means that the password is set too simply. The password setting rule is to contain numbers, uppercase and lowercase letters, and strings. Finally, grant external network login permission, username is the user name, password is the login password mysql>grant all privileges on *.* to username@'%' identified by 'password'; 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:
|
<<: Detailed usage of Linux text search command find
>>: Detailed explanation of using grep command in Linux
Overlay network analysis Built-in cross-host netw...
Some students said that they encountered the prob...
Table of contents Usage scenarios How to achieve ...
All tags must be lowercase In XHTML, all tags must...
According to the principles of W3C, each start tag...
Busybox: A Swiss Army knife filled with small com...
1. golang:latest base image mkdir gotest touch ma...
Table of contents Purpose Module Installation Bas...
Preface I feel like my mind is empty lately, as I...
I believe that many people who have used MySQL fo...
Scenario Yesterday the system automatically backe...
HTML provides five space entities with different ...
A few days ago, a colleague received a points mal...
User Groups In Linux, every user must belong to a...
I just started working a few days ago and install...