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

Install Myql in yum mode

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Environment

OS:CentOS7.6

Mysql:Mysql5.7

Get update package

Mysql official website: https://dev.mysql.com/

Go to http://dev.mysql.com/downloads/repo/yum/ to download the rpm package and update it. # download mysql source installation package wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm# install MySQL source yum localinstall mysql57-community-release-el7-8.noarch.rpm# check whether the source is successfully installed yum repolist enabled | grep "mysql.*-community.*"

Installation

Modify the configuration yum install mysql version, install the MySQL5.7 version here, modify "enabled=1".

Vim / etc/yum.repos.d/mysql-community.repo#Enable to use MySQL 5.6 [mysql56-community] name=MySQL 5.6 Community Serverbaseurl= http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/enabled=0gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql[mysql57-community]name=MySQL 5.7 Community Serverbaseurl= http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/enabled=1gpgcheck=1gpgkey=file:/// Etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

Yum installation

Yum install mysql-community-server

Systemctl start mysqld / / start the mysql service

Systemctl status mysqld

Systemctl enable mysqld

Systemctl daemon-reload / / reload service

Configuration

A default password is generated when mysql5.7 is installed, and the file that looks at this password usually exists on / var/log/mysqld.log.

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

Log in to mysql

Mysql-uroot-p

You can see that the mysql5.7 version is required to change the password after logging in by default. The password mechanism is adopted. The default is medium, and the password is required to have uppercase letters and special characters.

Change the password: mysql > set password for 'root'@'localhost'=password (' xxxxxxxx')

View password policy:

Mysql > show variables like'% password%'

0 = > LOW,1 = > MEDIUM,2 = > STRONG

Command line modification:

Set global validate_password_policy=0; / / set password policy level

Set global validate_password_length=6; / / set the minimum password length

Restart the mysql service

Systemctl restart mysqld

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