Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Binary installation mysql5.7 handout

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report