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 view and change passwords in CentOS7 installation Mysql5.7

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

In this article Xiaobian for you to introduce in detail "CentOS7 installation Mysql5.7 how to view and change the password", the content is detailed, the steps are clear, the details are handled properly, I hope this "CentOS7 installation Mysql5.7 how to view and modify the password" article can help you solve your doubts, the following follow the editor's ideas slowly in-depth, together to learn new knowledge.

Software version CentOS release 6.9 (Final) mysql Client Ver 14.14 Distrib 5.7.18, for Linux (x86x64) using EditLine wrappermysql Server 5.7.18 detects whether MySQLServer is installed

Check whether the system has its own mysql:yum list installed | grep mysql

If you already have one, execute the command yum-y remove mysql-libs.x86_64 to uninstall the installed MySQL.

Installation

Install the mysql server using the rpm package

Wget http://repo.mysql.com/yum/mysql-5.7-community/el/6/x86_64/mysql-community-server-5.7.18-1.el6.x86_64.rpmrpm-ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm launch service mysqld start to check password

The password for the connection is automatically generated in / var/log/mysqld.log after the installation is complete, and the generated password is viewed using the grep "temporary password" / var/log/mysqld.log command.

If you log in to the MySQL client for the first time, you must reset the password to manipulate the data, as follows:

[root@localhost src] # mysql-uroot-pEnter password:Welcome to the MySQL monitor. Commands end with; or\ g.Your MySQL connection id is 7Server version: 5.7.18Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or'\ h' for help. Type'\ c'to clear the current input statement.mysql > show databases;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement. Password settin

However, it should be noted that now that MySQL has mandatory strong passwords, weak passwords such as "123456" can no longer be used. If the password you set is too simple, it will prompt an error:

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

Set password command SET PASSWORD FOR 'root'@'localhost' = PASSWORD (' newpass'); mysqladmin command mysqladmin-u root password "newpass" # if root does not set a password use this way mysqladmin-u root password oldpass "newpass" if root sets a password use this way use update statement UPDATE user SET authentication_string = PASSWORD ('newpass') WHERE user =' root' Forget password mysqld_safe-- skip-grant-tables&mysql-u root mysqlmysql > UPDATE user SET authentication_string=PASSWORD ("new password") WHERE user='root';mysql > FLUSH PRIVILEGES; password complexity modification mysql > show variables like "validate_password%" +-- +-+ | Variable_name | Value | +-- +-+ | validate_password_check_ User_name | OFF | | validate_password_dictionary_file | | validate_password_length | 8 | # must be more than 8 characters | validate_password_mixed_case_count | 1 | validate_password_number_count | 1 | validate_password_policy | MEDIUM | # see the configuration below | validate_password_special_char_count | 1 | +-- -- +-+ 7 rows in set (0.01sec) mysql > SET GLOBAL validate_password_policy='LOW' Query OK, 0 rows affected (0.00 sec) mysql > SET GLOBAL validate_password_length = 6 rows affected query OK, 0 rows affected (0.00 sec)

The LOW policy only tests the length of passwords. The password must be at least 8 characters long.

Conditional passwords for MEDIUM policies must contain at least 1 numeric character, 1 uppercase and lowercase character, and 1 special (nonalphanumeric) character.

STRONG policy in the case of a codon string length of 4 or more that cannot match words in the dictionary file if a person is specified.

Try to change the password again.

Read this, the "CentOS7 installation Mysql5.7 how to view and change the password" article has been introduced, want to master the knowledge of this article also need to practice and use in order to understand, if you want to know more related articles, welcome to follow the industry information channel.

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