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

CentOS6.9 installation mysql5.7.21 tutorial

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

Share

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

CentOS6.9 installation mysql5.7.21 tutorial

The picture above first.

Installation succeeded:

Step1: check whether the system has its own installation mysql

Yum list installed | grep mysql

Step2: delete the mysql that comes with the system and its dependencies

Yum-y remove mysql-libs.x86_64

Step3: add a rpm source to CentOS and select a newer source

CeontOS6 can only use el6.

3.1Configuring YUM feed

Download the YUM source rpm installation package from the MySQL official website:

Download the mysql source installation package

Http://dev.mysql.com/downloads/repo/yum/

Wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm

3. 3 install mysql feeds

Yum localinstall mysql-community-release-el6-5.noarch.rpm

3.4 View enablement

Yum repolist all | grep mysql

3.5 setting to enable mysql57

Check whether the MySQL source is installed successfully

Yum repolist enabled | grep "mysql.-community."

Seeing the figure above indicates that the installation is successful.

3.6Modification to enable mysql57

You can modify the vim / etc/yum.repos.d/mysql-community.repo source to change the version of mysql installed by default. For example, if you want to install version 5.6, change the enabled=1 of the 5.7source to enabled=0. Then change the enabled=0 of the 5.6 source to enabled=1. The effect of the modification is as follows:

3.7View mysql enabled

Yum repolist enabled | grep mysql

Step4: install the mysql server 
 command:

Yum install mysql-community-server

If all goes well.

Step5: start the MySQL service

Service start mysqld

[ok]

Step6: view root temporary password

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

2018-01-07T01:25:58.867073Z 1 [Note] A temporary password is generated for root@localhost: umDn1uy4q > B

One of them; is also part of the password.

Step7: change the root password

Mysql-uroot-p

Mysql > ALTER USER 'root'@'localhost' IDENTIFIED BY' MyNewPass2passport'

If you just write a simple one, such as 123456, you will report an error.

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

This is actually related to the value of validate_password_policy.

Validate_password_policy has the following values:

The default is 1, that is, MEDIUM, so the password you set at the beginning must match the length and must contain numbers, lowercase or uppercase letters, and special characters.

Sometimes, just to test it myself, I don't want the password to be so complicated. For example, I just want to set the password for root to 123456.

Two global parameters must be modified:

First, modify the value of the validate_password_policy parameter

Mysql > set global validate_password_policy=0

Query OK, 0 rows affected (0.00 sec)

In this way, the criterion for judging the password is based on the length of the password. This is determined by the validate_password_length parameter.

Mysql > select @ @ validate_password_length

+-+

| | @ @ validate_password_length |

+-+

| | 8 |

+-+

1 row in set (0.00 sec)

Step8: setting up remote user

Mysq > GRANT ALL PRIVILEGES ON. TO 'oneusername'@'%' IDENTIFIED BY' Userpasswordkeeper' WITH GRANT OPTION

Setp9: setting port 3306

Vi / etc/my.cnf

Add:

[client]

Port = 3306

Default-character-set = utf8mb4

[mysqld]

Port = 3306

Step 10: open port 3306

Iptables-I INPUT 4-p tcp-m state-- state NEW-m tcp-- dport 3306-j ACCEPT

Service iptables save

Attached: mysql related documents and paths:

If your environment is different, or if you have other versions of mysql installed before, you can refer to this article to uninstall it first.

If you have any more questions about this, you are welcome to join the group. (QQ group: 292626152)

-recruit future gods

If you are helpful to others, willing to help others and willing to share

If you encounter a php question, Baidu still doesn't get an answer after asking other groups.

Welcome to join PHP Technical question and answer Group, QQ Group: 292626152

teaching benefits teachers as well as students! If you help others, you will also be promoted!

In order to cherish everyone's precious time, please don't chat!

May we help each other and make progress together!

Mainly refer to the following articles:

1.CentOS 6.5 Plus 6.6 installation (install) mysql 5.7 most complete version tutorial

Https://segmentfault.com/a/1190000003049498

Installation and configuration of MySQL5.7 under 2.CentOS7 64-bit (YUM)

Http://www.linuxidc.com/Linux/2016-09/135288.htm

Uninstall MySQL database under 3.Linux

Http://www.jb51.net/article/115227.htm

4.

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

Http://www.cnblogs.com/ivictor/p/5142809.html

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