Installation mysql manner yum installed rpm under CentOS7

I configured a lot of mysql on CentOS server lab, something special to this summary:

The most convenient way is yum install rpm ( Note: I give way, no need to modify any configuration file to everyone else )

Installation Code: (mysql5.7 for example)

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server

So even after installing the mysql can start the service, what you need to do is just wait

start up:

systemctl start  mysqld.service

View:

systemctl status mysqld.service

Direct input mysql -uroot -p you do not know your temporary password , this is actually a command line to get:

grep "password" /var/log/mysqld.log

 Log in directly with the temporary password:

This is the password you want to change, what else can not do anything, but to the pit:

Each version of mysql set password length is not the same, some 10, some eight, but can not be all numbers, letters, if you lose just a, you will be prompted an error, as follows:

 

Then, you see, and finally why I succeed? ? ? , Carefully student should have found out, I was to become my temporary password to change the password  , do not believe it look at temporary password above, it is not the same! , This will certainly comply with the password password specification! ! ! , Did not learn how to ~

Then you have to set up a more humane passwords such as "123456" when you can go and change the configuration of the mysql Note: if you do not first set the password above, is unable to operate mysql, so I will share the above techniques.

Mysql modify the configuration requirements for passwords:

show variables like 'validate%';

We want to change is that the two password length, grade, low grade your talent are all digital, length, they set themselves

 

set global validate_password_policy = 0;
 set global validate_password_length = 6;

Finally, you can then change your password, such as 123456:

 alter user 'root'@'localhost' identified by '123456';

over 

Guess you like

Origin blog.csdn.net/qq_38190111/article/details/89448774