Get the App
SLTechnology News&Howtos  ›  Servers  › 

Binary installation mysql5.7 handout

Shulou Source: shulou.com Published: 2022-06-03 06:43:13 10月25日 Update

This article mainly introduces the binary installation mysql5.7 handout, I hope you can supplement and update some knowledge, if you have other questions to understand, you can continue to follow my updated article in the industry information.

Binary installation mysql5.7

`

1. Create a user

Useradd-s / sbin/nologin-r-d / data/mysql mysql

two。 Create a directory

Mkdir / data/mysql

Chown mysql.mysql / data/mysql

3. Binary program

Tar xf mysql-5.7.27-el7-x86_64.tar.gz-C / usr/local/

Cd / usr/local

Ln-s mysql-5.7.27-el7-x86_64 mysql

Chown-R mysql.mysql / usr/local/mysql/

4. Configuration file

Vim / etc/my.cnf

[mysqld]

Server-id=7

Log-bin

Datadir=/data/mysql

Socket=/data/mysql/mysql.sock

Symbolic-links=0

Log-error=/data/mysql/mysql.log

Pid-file=/data/mysql/mysql.pid

[client]

Socket=/data/mysql/mysql.sock

5. Modify the PATH variable

Echo 'PATH=/usr/local/mysql/bin:$PATH' > / etc/profile.d/mysql.sh

. / etc/profile.d/mysql.sh

6. Generate database files

Mysqld-initialize-datadir=/data/mysql-user=mysql

If the error libaio does not exist, execute yum install-y libaio

The password will be printed on the screen or can be viewed in / data/mysql/mysql.log

7. Service startup script

Cp / usr/local/mysql/support-files/mysql.server / etc/rc.d/init.d/mysqld

Chkconfig-add mysqld

Systemctl start mysqld

8. Modify the password

The system-generated password can be viewed in the error log / data/mysql/mysql.log: sed-nr "s / (. *) root@localhost: (. *) /\ 2Unip" / data/mysql/mysql.log

Mysqladmin-uroot-paired password centos (1lquantewalled Y' password centos

`

Read the above on the binary installation of mysql5.7 handouts, I hope to give you some help in practical application. Due to the limited space in this article, it is inevitable that there will be deficiencies and need to be supplemented. If you need more professional answers, you can contact us on the official website for 24-hour pre-sales and after-sales to help you answer questions at any time.

Tags: Binary password handout file question update generation solution specialty variable available in place actual hour screen data database article log limited Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Linux Shulou Information MariaDB Xiaomi