Get the App
SLTechnology News&Howtos  ›  Database  › 

Centos7 configuration yum Source installation mysql simple tutorial

Shulou Source: shulou.com Published: 2022-06-01 19:32:21 09月21日 Update

The following is about centos7 configuration yum source installation mysql simple tutorial, the secret of the text is close to the topic. So, no gossip, let's go straight to the following, I believe you will benefit from this article after reading the simple tutorial of centos7 configuration yum source installation mysql.

Configure yum source installation mysql (default installation version 5.7)

[root@localhost ~] # wget https://repo.mysql.com//mysql57-community-release-el7-9.noarch.rpm

[root@localhost ~] # mysql57-community-release-el7-9.noarch.rpm

Note: you can modify the mysql-community.repo source and select the version of mysql under / etc/yum.repo.d/ (for example, if you install version 5.6, change the enabled=1 of 5.7source to enabled=0. Then change the enabled=0 of the 5.6 source to enabled=1)

Second, install mysql

Yum-y installmysql-community-server

3. Start mysql service

[root@localhost ~] # Systemctlstart mysqld # start

[root@localhost ~] # systemctlstatus mysqld # View the running status

The status shown below indicates that mysql has been installed successfully:

● mysqld.service-MySQL Server

Loaded: loaded (/ usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)

Active: active (running) since Fri 2017-04-21 11:58:11 CST; 39min ago

4. Reset the root password

Note: after the mysql installation is successful, a default root password is generated in the mysql log file, find the command:

[root@localhost ~] # cat / var/log/mysqld.log | grep temporary

2017-04-21T03:58:07.638266Z 1 [Note] A temporary password is generated for root@localhost:: fwi#eQ#j8Kj

Copy string password to log in to mysql

[root@localhost ~] # mysql-uroot-p:fwi#eQ#j8Kj (the string after-p is the default generated password)

You must reset the root password after logging in, as follows:

Mysql > set password=password ('new password')

There may be a mistake!

ERROR 1819 (HY000): Your passworddoes not satisfy the current policy requirements

Reason: at the beginning, the password must comply with the password complexity policy. Mysql5.7 has installed the password Security check plug-in (validate_password) by default. The default password check policy requires that the password must contain uppercase and lowercase letters, numbers and special symbols, and that the length must not be less than 8 digits.

Enter these two commands separately to solve the problem:

Mysql > set global validate_password_policy=0

Mysql > set global validate_password_length=4

Continue to execute

Mysql > set password=password ('123456')

Query OK, 0 rows affected, 1 warning (0.09 sec)

Mysql > flush privileges

Password changed successfully! Effective after withdrawal!

For the above centos7 configuration yum source installation mysql simple tutorial related to the content, is there anything you do not understand? Or if you want to know more about it, you can continue to follow our industry information section.

Tags: Password configuration tutorial success command character string version status policy check login complexity special security following topic content reason place Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Linux Huawei Shulou Technology macOS