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 to install mysql8.0 in linux environment

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article mainly explains "how to install mysql8.0 in linux environment". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to install mysql8.0 in linux environment.

1. Linux changes the yum source (you can try if MYSQL installation is slow)

Introduction: because it is the official yum, it may lead to slow installation, so we switch to the domestic source.

Step 1: enter the yum configuration file directory

Cd / etc/yum.repos.d/

Step 2: back up the configuration file (you can restore it if there is a problem later):

Mv means: rename

Cp means: copy

Mv CentOS-Base.repo CentOS-Base-yum.repo

Step 3: download NetEase yum

Wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

The file you downloaded is called CentOS6-Base-163.repo

Rename

Mv CentOS6-Base-163.repo CentOS-Base.repo

Step 4: update the configuration

Yum update II. Version

Version 8.0

Wget http://repo.mysql.com/mysql80-community-release-el7-3.noarch.rpm

Version 5.7

Wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm III. Installation

Version 8.0

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

Version 5.7

Sudo rpm-ivh mysql5.7-community-release-el7-8.noarch.rpm

Installation

Sudo yum install mysql-server

Just y all the time.

4. Check the temporary password

1. Restart the database

Systemctl restart mysqld

two。 View temporary passwords generated by log

Grep "A temporary password" / var/log/mysqld.log

3. Change the password (the pit that Ken will encounter, you can see the problem at the end) and enter the database.

Mysql-u root-p

Enter a temporary password to access the database

Modify password length

If it's root, it's 4.

Set global validate_password.length=4

Modify complexity

Set global validate_password.policy=0

Modify the account and password to be the same (if different, you can not configure it)

Set global validate_password.check_user_name=off

Modify

ALTER USER 'root'@'localhost' IDENTIFIED BY' New password

Exit the database

Exit 5. Configure that the public network can access

1. Access to the database

Mysql-u root-p

Enter the password to access the database

two。 Access to mysql database

Use mysql

3. Configure acc

Update user set host='%' where user='root'

4. Refresh permissions

Flush privileges

5. Exit the database

Exit

6. Restart

Systemctl restart MySQL VI, testing

VII. Uninstall the database

1. View installed mysql

Rpm-qa | grep-I mysql

two。 Unloading

Yum remove name

3. Delete data

Rm-rf / var/lib/ MySQL VIII, problem

There is a situation of playing tai chi.

At the beginning of entering the database, it is not possible to change the password or the length of the password. The two sides throw pots at each other and play tai chi.

Solution (which means to change the password first) 1. First change the password to generate the password

Mine is: + Eiyth9dW7ba

ALTER USER 'root'@'localhost' IDENTIFIED BY' generate password'

two。 Modify the minimum length

Modify according to the length of your password

Set global validate_password.length=4

3. Modify complexity

Set global validate_password.policy=0

4. Modify the password

ALTER USER 'root'@'localhost' IDENTIFIED BY' new password; at this point, I believe you have a deeper understanding of "how to install mysql8.0 in linux environment". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Development

Wechat

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

12
Report