Centos7 offline installation of MySQL

Source: Internet
Author: User

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

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.