Centos7 rpm Mode installation MySQL5.7
1, download the Linux corresponding RPM package, CentOS7 corresponding RPM package, as follows:
[[email protected] soft]# unzip mysql-5.7-centos7.zip archive: mysql-5.7-centos7.zip extracting: mysql-commercial-client-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-embedded-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-common-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-libs-compat-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-embedded-compat-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-devel-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-test-5.7.16-1.1.el7.x86_64.rpm extracting: mysql-commercial-embedded-devel-5.7.16-1.1.el7.x86_64.rpm extracting: Mysql-commercial-libs-5.7.16-1.1.el7.x86_64.rpm extracting:&nbsP README.txt
2, check MySQL and related RPM package, whether installed, if there is installation, then remove (rpm–e name)
[[email protected] soft] #rpm-qa | Grep-i Mariadb-*[[email protected] soft]# rpm-e mariadb-libs Otherwise it might be an error: [[email protected] soft]# RPM-IVH Mysql-commercia l-libs-5.7.16-1.1.el7.x86_64.rpm Warning:mysql-commercial-libs-5.7.16-1.1.el7.x86_64.rpm:header V3 DSA/SHA1 Signature, Key ID 5072e1f5:nokeyerror:failed Dependencies:mysql-commercial-common (x86-64) >= 5.7.9 is needed by MySQL -commercial-libs-5.7.16-1.1.el7.x86_64mariadb-libs is obsoleted by mysql-commercial-libs-5.7.16-1.1.el7.x86_64
[[Email protected] soft]# rpm -ivh mysql-commercial-common-5.7.16-1.1.el7.x86_ 64.rpmwarning: mysql-commercial-common-5.7.16-1.1.el7.x86_64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing... ################################# [100%]updating / installing... 1: mysql-commercial-common-5.7.16-1.################################# [100%][[email protected] Soft]# rpm -ivh --force mysql-commercial-libs-5.7.16-1.1.el7.x86_64.rpm warning: mysql-commercial-libs-5.7.16-1.1.el7.x86_64.rpm: Header V3 DSA/SHA1 Signature, key id 5072e1f5: nokeypreparing... ################################# [100% ]updating / installing... 1:mysql-commercial-libs-5.7.16-1.1.###################### ########### [100%][[email protected] soft]# rpm -ivh Mysql-commercial-client-5.7.16-1.1.el7.x86_64.rpmwarning: mysql-commercial-client-5.7.16-1.1.el7.x86_64. Rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing ... ################################# [100%]updating / installing... 1:mysql-commercial-client-5.7.16-1.################################# [100%] Test pre-installation tips are as follows:[[email protected] soft]# rpm -ivh --test mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpmwarning:&Nbsp;mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeyerror: failed dependencies:net-tools is needed  BY MYSQL-COMMERCIAL-SERVER-5.7.16-1.1.EL7.X86_64 Note: Need to rely on net-tools components [[Email protected] soft] # yum install net-toolsloaded plugins: fastestmirrorloading mirror speeds from cached hostfile * base: centos.ustc.edu.cn * epel: mirror01.idc.hinet.net * extras: centos.ustc.edu.cn * updates: Centos.ustc.edu.cnresolving dependencies--> running transaction check---> package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed--> finished dependency resolutiondependencies resolved============================================ ================================================================================== package Arch Version Repository size============================ ==================================================================================================installing: net-tools x86_64 2.0-0.17.20131004git.el7 base 304 ktransaction summary============================ ==================================================================================================install 1 packagetotal download size: 304 kinstalled size: 917 kis this ok [y/d/n]: ydownloading packages:net-tools-2.0-0.17.20131004git.el7.x86_64.rpm |&nBsp;304 kb 00:00:00 running transaction checkrunning transaction testtransaction test succeededrunning transactionwarning: rpmdb altered outside of yum.** found 2 pre-existing rpmdb problem (s), ' Yum check ' output follows:2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18 () (64bit) 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18 (libmysqlclient_18) (64bit) Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 &nBsp; 1/1 verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1 Installed: net-tools.x86_64 0:2.0-0.17.20131004git.el7 complete! [[email protected] soft]# rpm -ivh --test Mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpmwarning: mysql-commercial-server-5.7.16-1.1.el7.x86_64. Rpm: header v3 dsa/sha1 signature, key id 5072e1f5: nokeypreparing ... ################################# [100%][[email protected] soft]# rpm -ivh mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpmwarning: Mysql-commercial-server-5.7.16-1.1.el7.x86_64.rpm: header v3 dsa/sha1 signature, key ID 5072e1f5: NOKEYPreparing... ################################# [100%] updating / installing... 1:mysql-commercial-server-5.7.16-1.####################### ########## [100%]
4, Backup my.cnf, re-initialize the database, note that mysql5.7 version initialization randomly generates a root login random password
[[email protected] sbin] #cp/etc/my.cnf/etc/my.cnf.bak[[email protected] sbin]#/usr/sbin/mysqld--initialize--user= MySQL--basedir=/data--datadir=/data 2016-11-18t05:49:59.052988z 1 [Note] A temporary password is generated for [email PR Otected]: T=_GTJ2WROXM (root local login random password)
5. Start the service and change the root password
[[email protected] sbin]# systemctl start mysqld.servicemysql> alter user ' root ' @ ' localhost ' identified by ' 12345678 '; Query OK, 0 rows Affected (0.00 sec)
6. Post-installation directory location and content
The following directories are involved in MySQL installation:
Content in the directory directory
/usr/bin client programs and scripts
/usr/sbinmysqld Server
Log files for the/var/lib/mysql database
/usr/share/info Information Format manual
/usr/share/manUnix manual page
/usr/include/mysql include (title) files
/usr/lib/mysqlMySQL lib package
/usr/share/mysql Miscellaneous support files, including error messages) character set file, sample configuration file, SQL database installation
/usr/share/sql-bench Benchmark
The default character set is: Utf8_general_ci
Mysql> Show variables like '%collation% '; +----------------------+-------------------+| variable_name | Value |+----------------------+-------------------+| collation_connection | Utf8_general_ci | | Collation_database | Latin1_swedish_ci | | Collation_server | Latin1_swedish_ci |+----------------------+-------------------+3 rows in Set (0.01 sec)
This article is from the "10,000-hour Law" blog, be sure to keep this source http://daisywei.blog.51cto.com/7837970/1875056
Centos7 rpm Mode installation MySQL5.7