About Linux-centos 7 How to install the RPM package for MySQL 5.7.9

Source: Internet
Author: User

Tag: The installer for the RPM package of MySQL 5.7.9

Introduction to Environment >>>>>>>>>>>>>>>>>>

Operating system: Centos 7.1

MySQL database version: mysql5.7.9

MySQL official website: http://www.mysql.com

------------------------------------------

1, before installing the new version of MySQL, we need to bring the system Mariadb-lib Uninstall

[Email protected] ~]# rpm-qa|grep mariadbmariadb-libs-5.5.41-2.el7_0.x86_64[[email protected] ~]# rpm-e Mariadb-libs-5.5.41-2.el7_0.x86_64--nodeps

2. Download the latest version of MySQL's RPM collection pack from MySQL's website: mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar

3, upload Mysql-5.7.9-1.el7.x86_64.rpm-bundle.tar to Linux server, and unzip the tar package

[Email protected] mysql]# mkdir RPM

[[Email protected] mysql]# CD RPM

[Email protected] rpm]# rz-y

RZ waiting to receive.

Starting Zmodem transfer. Press CTRL + C to cancel.

Transferring Mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar ...

100% 570950 KB 8274 kb/sec 00:01:09 0 Errors


[[email protected] rpm]# ls

Mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

[Email protected] rpm]# TAR-XF Mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

[[email protected] rpm]# ls

Mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar mysql-community-libs-5.7.18-1.el7.x86_64.rpm

mysql-community-client-5.7.18-1.el7.x86_64.rpm mysql-community-libs-compat-5.7.18-1.el7.x86_64.rpm

mysql-community-common-5.7.18-1.el7.x86_64.rpm mysql-community-minimal-debuginfo-5.7.18-1.el7.x86_64.rpm

mysql-community-devel-5.7.18-1.el7.x86_64.rpm mysql-community-server-5.7.18-1.el7.x86_64.rpm

mysql-community-embedded-5.7.18-1.el7.x86_64.rpm mysql-community-server-minimal-5.7.18-1.el7.x86_64.rpm

mysql-community-embedded-compat-5.7.18-1.el7.x86_64.rpm mysql-community-test-5.7.18-1.el7.x86_64.rpm

mysql-community-embedded-devel-5.7.18-1.el7.x86_64.rpm

4, one of the simplest installation Mysql-server service, only need to install the following 4 packages, we can use the RPM-IVH command to install

     MYSQL-COMMUNITY-COMMON-5.7.9-1.EL7.X86_64.RPM
      mysql-community-libs-5.7.9-1.el7.x86_64.rpm            -(dependent on common)
     mysql-community-client-5.7.9-1.el7.x86_64. RPM          --(dependent on Libs)
     mysql-community-server-5.7.9-1.el7.x86_64.rpm        -(dependent on client, common)

5, followed by the initialization of the database, we use the following several commands can be, the effect is the same

[[email protected] ~]# mysql_install_db--datadir=/var/lib/mysql//Must specify DataDir, after execution will generate ~/.mysql_secret password file [email Protected] ~]# mysqld--initialize//New version recommended This method, the executive will generate random passwords in/var/log/mysqld.log

6. Change the user and the group to which the MySQL database directory belongs, and then start the MySQL database

[[email protected] ~]# chown mysql:mysql/var/lib/mysql-r[[email protected] ~]# systemctl start Mysqld.service Start the MySQL database service

7, according to the password in the 5th step to log in to MySQL, change the root user's password, the new version of MySQL after the first login to change the password is not able to execute any command

[[email protected] ~]# mysql-uroot-p ') J #) =urig4yj ' mysql> set Password=password (' www.cnblogs.com/5201351 ');

8, finally we can also create a user according to the actual situation, and for the permission assignment

mysql> create user ' root ' @ ' 192.168.100.2 ' identified by ' QQ5201351 '; Mysql> GRANT all privileges in dbname.* to ' root ' @ ' 192.168.100.2 ';mysql> flush Privileges

==============================================

Finally, it is important to note that there is no password field in the user table in the new MySQL database.

Instead, the encrypted user password is stored in the authentication_string field


About Linux-centos 7 How to install the RPM package for MySQL 5.7.9

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.