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

How does the mysql yum source installation work

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how the mysql yum source installation is carried out. The content of the article is of high quality. Therefore, Xiaobian shares it with you as a reference. I hope you have a certain understanding of relevant knowledge after reading this article.

mysql is often installed when deploying server environments, and the following are common installation methods

Source code installation rpm package installation yum source installation

This article mainly introduces yum source installation.

Yum Source Download

Go to/d/file/shujuku/icfr0hcnmxe page, you can see that there are many download items, we select MySQL Yum Repository(corresponding link is: /d/file/shujuku/icfr0hcnmxerepo/yum/) item to enter, select the required package download, here I choose mysql80-community-release-el7-3.noarch.rpm

Or you can download it directly from the linux command line by executing the following command

wget/d/file/shujuku/3syf5bewzyj.rpm

Install yum source

Go to mysql80-community-release-el7 -3.noarch.rpm download directory

rpm-ivh mysql80-community-release-el7-3.noarch.rpm

Modify download links for yum sources

After yum source installation, the default download link speed is relatively slow, you need to modify the download link, domestic generally can be modified to Alibaba Cloud link

Backup the yum source configuration file that comes with the system

mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.bak

Download aliyun's yum source configuration file to/etc/yum.repos.d/

cd/etc/yum.repos.d/

wget-O/etc/yum.repos.d/CentOS-Base.repo/d/file/shujuku/4ytqju3tsdk.repo

choose variant

yum source configuration file will contain multiple versions of mysql, the default will select the latest version (currently MySQL 8.0), here we select MySQL 5.7, edit the/etc/yum.repos.d/mysql-community.repo file, set the enabled of [mysql57-community] to 1, set the default enabled of [mysql80-community] to 0

vim/etc/yum.repos.d/mysql-community.repo

#Enable to use MySQL 5.7

[mysql57-community]

name=MySQL 5.7 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

install MySQL

Install MySQ using the following command, which installs MySQL services and other MySQL packages

yum install mysql-community-server

start the MySQL

After installation, start MySQL with the following command

systemctl start mysqld

MySQL does the following when it is first started

Initialize the data directory of the server and generate SSL certificates and key files Install the validate_password component and take effect Create a super account 'root''localhost', generate a password for the super account and save the password to the error log, obtain the password by

grep'temporary password'/var/log/mysqld.log

The root password is temporarily generated and needs to be modified as soon as possible. Use the following command to modify it

shell>mysql-uroot-p

mysql>ALTER USER'root' 'localhost'IDENTIFIED BY'NewPassword';

Modify MySQL configuration

mysql configuration default is in/etc/my.cnf, you can set options according to the specific needs of the project, the following are a few common settings

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

character-set-server=utf8

port=3306

collation-server=utf8_general_ci

expire-logs-days=300

max_connections=1024

default_storage_engine=InnoDB

About mysql yum source installation is how to share here, I hope the above content can be of some help to everyone, you can learn more knowledge. If you think the article is good, you can share it so that more people can see it.

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