Install MySQL 7.3 in CentOS 5.7 and change the initial password.

Source: Internet
Author: User

Install MySQL 7.3 in CentOS 5.7 and change the initial password.
Install MySQL 7.3 in CentOS 5.7 and change the initial password. For more information about installing MySQL 5.7 in Windows, see http://www.linuxidc.com/linux/2017-11/148521.htm1、 文

Http://dev.mysql.com/doc/mysql-yum-repo-quick-guide/en/

2. Download the Mysql yum package

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

Download it to your local computer and then upload it to the server, or use wget to download it directly.

wget http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm
3. Security Handover software source

Setplatform-and-version-specific-package-nameReplace with the rpm name you downloaded

sudo rpm -Uvh platform-and-version-specific-package-name.rpm

For example

rpm -Uvh mysql57-community-release-el7-10.noarch.rpm

4. Install the mysql server
 yum install  -y  mysql-community-server

If the network environment is not good, run the command to make a cup of tea or kill the game with honor.

5. Start mysql
service mysqld start
systemctl start mysqld.service
6. Check the running status of mysql
service mysqld status
systemctl status mysqld.service
7. Change the temporary password

After Mysql5.7 is installed by default, the root user has a password.

7.1 obtain the temporary password of MySQL

To enhance security, MySQL5.7 randomly generates a password for the root user. In the error log, for the location of the error log, if the RPM package is installed, the default value is/var/log/mysqld. log.
You can view the temporary password only once after mysql is started.

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

 
The password here isYdsGaxOq>2n!

7.2 log on and change the password

Log On with the default password

mysql -uroot -p

After logging on to the server with this password, you must change the password immediately. Otherwise, the following error will be reported:

mysql> select @@log_error;ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.mysql>

Change Password

ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';

If the password is too simple, the following prompt appears:

SolutionERROR 1819 (HY000): Your password does not satisfy the current policy requirementsWhat about it? A detailed description of the solution is provided here.

You must modify two global parameters:
First, modify the value of the validate_password_policy parameter.

mysql> set global validate_password_policy=0; 

Change the password length.

set global validate_password_length=1;

You can change the password again.

ALTER USER 'root'@'localhost' IDENTIFIED BY 'root123';
8. authorize other machines to log on
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;FLUSH  PRIVILEGES;
9. Detailed descriptions of password settings

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

Http://www.linuxidc.com/Linux/2016-01/127831.htm

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2017-11/148522.htm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.