CentOS7 install MySql (mysql downloaded installation package)

1. Download the installation package uploaded to a good linux:

2. Check whether there is a local mysql existing package

rpm -qa | grep mysql

3. Detection of whether there is a local existing package mariadb

rpm -qa | grep mariadb

4. If so, the unload command with yum

yum -y remove mariadb-libs-5.5.54-2.el7.x86_64
//或者
rpm -e --nodeps mariadb-libs-5.5.54-2.el7.x86_64

5. Create a folder, upload jar package to the / opt / software / mysql

mkdir /opt/module/mysql

6. decompression mysql jar package

tar -xvf mysql-5.7.19-1.el7.x86_64.rpm-bundle.tar -C /opt/module/mysql

7. server installation of mysql, client, common, libs, lib-compat

rpm -ivh --nodeps mysql-community-server-5.7.19-1.el7.x86_64.rpm
rpm -ivh --nodeps mysql-community-client-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-common-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-5.7.19-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-compat-5.7.19-1.el7.x86_64.rpm

image.png

8. Check the mysql service is started

systemctl status mysqld


9. Start mysql service

systemctl start mysqld

image.png

10. Check the mysql service is started again

systemctl status mysqld

11. Review the default password generated

cat /var/log/mysqld.log | grep password

Review the default generated password

12. Log mysql service

mysql -uroot -p’然后粘贴上密码’

13. Modify mysql password rules

0 or LOW length
1 or MEDIUM Length, capitalization, numbers, special characters
2 or STRONG Length, capitalization, numbers, special characters, dictionary

Note: The following modifications are temporarily modify
a check password strength levels, 0 / LOW, 1 / MEDIUM , 2 / STRONG.

set global validate_password_policy=0;

The number of uppercase and lowercase letters number of letters b. Contains at least the password

set global validate_password_mixed_case_count=0;

c. at least a number of digits to be included password

set global validate_password_number_count=3;

d. number of special characters in the password to include at least

set global validate_password_special_char_count=0;

e. minimum password length, parameter defaults to 8,

set global validate_password_length=3;

    It has a minimum limit, minimum value: number of lowercase and uppercase letters of at least the number of digits to be included in the password least validate_password_special_char_count special character + (2 * validate_password_mixed_case_count) to include validate_password_number_count +

  1. change Password:
SET PASSWORD FOR 'root'@'localhost'=PASSWORD('000000');

(These two steps can be skipped)

use mysql;
SHOW VARIABLES LIKE 'validate_password%';
Variable_name Value
validate_password_dictionary_file
validate_password_length 3
validate_password_mixed_case_count 0
validate_password_number_count 3
validate_password_policy LOW
validate_password_special_char_count 0

15. Modify remote login privileges

As shown above: This is a remote link was successfully configured
all default location% is localhost, which means that only native access

Query the current root login privileges in the user table:

select host,user from mysql.user;

Modify the permissions for all%:

update mysql.user set host = '%' where user = 'root';

Refresh cache:

flush privileges;

Published 18 original articles · won praise 0 · Views 469

Guess you like

Origin blog.csdn.net/aflyingcat520/article/details/105332214