Get the App
SLTechnology News&Howtos  ›  Database  › 

Centos7 install mysql5.7

Shulou Source: shulou.com Published: 2022-06-01 04:20:57 09月19日 Update

System environment: Centos7.4

The steps to build are as follows:

1. First go to the source file directory of this machine

[root@edu-mycat-01 ~] # cd / usr/local/src/

two。 Use wget to download the rpm package of the official Yum source:

[root@edu-mycat-01 src] # wget https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm

3. Install the RPM package

Uninstall the original package mariadb-libs first

[root@edu-mycat-01 src] # yum remove mariadb-libs-y

[root@edu-mycat-01 src] # rpm-ivh mysql57-community-release-el7-11.noarch.rpm

4. Use yum again to install mysql-serve

[root@edu-mycat-01 ~] # yum-y install mysql-community-server

Check to see if it started successfully:

[root@edu-mycat-01 ~] # ps-aux | grep mysqld

5. Set the mysqld service to boot automatically:

[root@edu-mycat-01 ~] # systemctl enable mysqld

6. Log in with the initial password

[root@edu-mycat-01 ~] # cat / var/log/mysqld.log | grep'A temporary password'

[root@edu-mycat-01] # mysql-uroot-p

Reason for error: (password is too simple)

Mysql > set global validate_password_policy=0

Mysql > set global validate_password_length=1

Mysql > set global validate_password_mixed_case_count=2

Mysql > alter user 'root'@'localhost' identified by' mysqlpasswd'

Log back in successfully and complete the installation!

Tags: Success password login again reason official step source file environment directory system Laian local service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Xiaomi Apple Redmi MariaDB