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

Centos7 installation single node mysql (rpm package installation)

2025-03-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Check whether the following software package is installed, and if it is uninstalled.

# rpm-qa | grep postfix

# rpm-qa | grep mariadb

# rpm-qa | grep mysql

2. Create a directory

Create a package storage directory

# mkdir / data/packages

Create an mysql data directory

# mkdir / data/mysql_data

3. Decompress and install

# cd / data/packages

# tar-xf mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

# rpm-ivh mysql-community-common-5.7.18-1.el7.x86_64.rpm

# rpm-ivh mysql-community-libs-5.7.18-1.el7.x86_64.rpm

# rpm-ivh mysql-community-client-5.7.18-1.el7.x86_64.rpm

# rpm-ivh mysql-community-server-5.7.18-1.el7.x86_64.rpm

4. Grant permissions and set boot self-startup

# chown mysql:mysql / data/mysql_data

# systemctl enable mysqld.service

5. Edit the configuration file

# vi / etc/my.cnf

[mysql]

Default-character-set=utf8

Datadir=/data/mysql_data

Default-storage-engine=INNODB

Character_set_server=utf8

Expire_logs_days=15

Innodb_buffer_pool_size=8G

Innodb_log_file_size=256M

Innodb_flush_method=O_DIRECT

Max_connections=500

Innodb_autoextend_increment=128

Sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

6. Start the service and set the login password

# systemctl start mysqld.service

View initial password

# grep "root@localhost" / var/log/mysqld.log | awk'{print $11}'

Log in with the initial password and change the password

# mysql-uroot-p

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

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

Database

Wechat

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

12
Report