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-name
Replace 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 requirements
What 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