1, install the new version of MySQL before the system to bring the Mariadb-lib uninstall
Rpm-qa|grep mariadb
[[Email protected]]# mariadb-libs-5.5.44-2.el7.centos.x86_64
RPM-E--nodeps mariadb-libs-5.5.44-2.el7.centos.x86_64
2. Download MySQL offline package
: https://dev.mysql.com/downloads/mysql/#downloads
Decompression: Tar xvf Mysql-5.7.16-1.el7.x86_64.rpm-bundle.tar
3. Create the Yum source for MySQL
Createrepo MySQL Directory
Add Yum source file
4. Install MySQL
Yum Install Mysql-server
5. Get MySQL Password
Password in/var/log/mysqld.log, get: grep "password"/var/log/mysqld.log
After you log on to the server with this password, you must change the password immediately, or you will receive the following error:
Mysql> Select User ();
ERROR 1820 (HY000): Must reset your password using ALTER USER statement before executing this statement.
If you just change to a simple password, the following error will be reported:
mysql> ALTER User User () identified by ' 12345678 ';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
This is actually related to the value of Validate_password_policy.
Reference: https://www.cnblogs.com/ivictor/p/5142809.html
6. Change the password
Set global validate_password_policy=0;
Set global validate_password_length=1;
ALTER User User () identified by ' 12345678 ';
Or: Set Password=password (' MySQL ');
7. Set up MySQL Boot
Check if the boot is already on
Systemctl List-unit-files | grep mysqld
Boot up
Systemctl Enable Mysqld.service
8, create users, assign permissions, remote login authorization
Mysql-uroot-pmysql
GRANT all privileges on * * to ' root ' @ '% ' identified by ' MySQL ' with GRANT OPTION;
FLUSH privileges;
Initializing the Hive Library
Mysql-u Root-pmysql
CREATE USER ' hive ' @ '% ' identified by ' hive ';
GRANT all privileges on * * to ' hive ' @ '% ';
CREATE USER ' hive ' @ ' localhost ' identified by ' hive ';
GRANT all privileges on * * to ' hive ' @ ' localhost ';
CREATE USER ' hive ' @ ' hostname ' identified by ' hive ';
GRANT all privileges on * * to ' hive ' @ ' hostname ';
FLUSH privileges;
CREATE DATABASE ' hive ' DEFAULT CHARACTER SET UTF8 COLLATE utf8_general_ci;
Centos7 offline installation of MySQL