How to Install MySQL on Linux Using RPM Packages

Install MySQL with another different way.

1) Download RPM packages zip file “V74391-01.zip” for MySQL 5.6.23 with files below:

MySQL RMP packages

2) unpack the zip file.

# unzip V74391-01.zip
Archive: V74391-01.zip
 extracting: MySQL-shared-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-test-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-devel-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-embedded-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-server-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: MySQL-client-advanced-5.6.23-1.el7.x86_64.rpm 
 extracting: README.txt

3)To perform a standard minimal installation, install the server and client RPMs:

#rpm -i MySQL-server-advanced-5.6.23-1.el7.x86_64.rpm
#rpm -i MySQL-client-advanced-5.6.23-1.el7.x86_64.rpm

4) Or to install packages using yum. In a directory containing all RPM packages for a MySQL release, “yum install MySQL*rpm” installs them in the correct order.

 [root@racnode1 MySQL_5_6_23_RPMS]# yum install MySQL*rpm
Loaded plugins: langpacks
Examining MySQL-client-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-client-advanced-5.6.23-1.el7.x86_64
Marking MySQL-client-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-devel-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-devel-advanced-5.6.23-1.el7.x86_64
Marking MySQL-devel-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-embedded-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-embedded-advanced-5.6.23-1.el7.x86_64
Marking MySQL-embedded-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-server-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-server-advanced-5.6.23-1.el7.x86_64
Marking MySQL-server-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-shared-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-shared-advanced-5.6.23-1.el7.x86_64
Marking MySQL-shared-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64
Marking MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Examining MySQL-test-advanced-5.6.23-1.el7.x86_64.rpm: MySQL-test-advanced-5.6.23-1.el7.x86_64
Marking MySQL-test-advanced-5.6.23-1.el7.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package MySQL-client-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-devel-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-embedded-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-server-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-shared-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-shared-compat-advanced.x86_64 0:5.6.23-1.el7 will be installed
---> Package MySQL-test-advanced.x86_64 0:5.6.23-1.el7 will be installed
--> Finished Dependency Resolution
http://linuxdownload.adobe.com/linux/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: linuxdownload.adobe.com; Unknown error"
Trying other mirror.
http://public-yum.oracle.com/repo/OracleLinux/OL7/UEKR3/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: public-yum.oracle.com; Unknown error"
Trying other mirror.
http://public-yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: public-yum.oracle.com; Unknown error"
Trying other mirror.

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Installing:
 MySQL-client-advanced x86_64 5.6.23-1.el7 /MySQL-client-advanced-5.6.23-1.el7.x86_64 74 M
 MySQL-devel-advanced x86_64 5.6.23-1.el7 /MySQL-devel-advanced-5.6.23-1.el7.x86_64 17 M
 MySQL-embedded-advanced x86_64 5.6.23-1.el7 /MySQL-embedded-advanced-5.6.23-1.el7.x86_64 485 M
 MySQL-server-advanced x86_64 5.6.23-1.el7 /MySQL-server-advanced-5.6.23-1.el7.x86_64 264 M
 MySQL-shared-advanced x86_64 5.6.23-1.el7 /MySQL-shared-advanced-5.6.23-1.el7.x86_64 8.1 M
 MySQL-shared-compat-advanced x86_64 5.6.23-1.el7 /MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64 11 M
 MySQL-test-advanced x86_64 5.6.23-1.el7 /MySQL-test-advanced-5.6.23-1.el7.x86_64 342 M

Transaction Summary
======================================================================================================================================================
Install 7 Packages

Total size: 1.2 G
Installed size: 1.2 G
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Installing : MySQL-client-advanced-5.6.23-1.el7.x86_64 1/7 
 Installing : MySQL-devel-advanced-5.6.23-1.el7.x86_64 2/7 
 Installing : MySQL-embedded-advanced-5.6.23-1.el7.x86_64 3/7 
 Installing : MySQL-test-advanced-5.6.23-1.el7.x86_64 4/7 
 Installing : MySQL-server-advanced-5.6.23-1.el7.x86_64 5/7 
 Installing : MySQL-shared-advanced-5.6.23-1.el7.x86_64 6/7 
 Installing : MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64 7/7 
 Verifying : MySQL-embedded-advanced-5.6.23-1.el7.x86_64 1/7 
 Verifying : MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64 2/7 
 Verifying : MySQL-devel-advanced-5.6.23-1.el7.x86_64 3/7 
 Verifying : MySQL-shared-advanced-5.6.23-1.el7.x86_64 4/7 
 Verifying : MySQL-test-advanced-5.6.23-1.el7.x86_64 5/7 
 Verifying : MySQL-server-advanced-5.6.23-1.el7.x86_64 6/7 
 Verifying : MySQL-client-advanced-5.6.23-1.el7.x86_64 7/7 

Installed:
 MySQL-client-advanced.x86_64 0:5.6.23-1.el7 MySQL-devel-advanced.x86_64 0:5.6.23-1.el7 MySQL-embedded-advanced.x86_64 0:5.6.23-1.el7 
 MySQL-server-advanced.x86_64 0:5.6.23-1.el7 MySQL-shared-advanced.x86_64 0:5.6.23-1.el7 MySQL-shared-compat-advanced.x86_64 0:5.6.23-1.el7 
 MySQL-test-advanced.x86_64 0:5.6.23-1.el7 

Complete!

5) Check installed MySQL packages:

[root@racnode1 MySQL_5_6_23_RPMS]# rpm -qa |grep -i mysql
MySQL-client-advanced-5.6.23-1.el7.x86_64
MySQL-test-advanced-5.6.23-1.el7.x86_64
MySQL-shared-compat-advanced-5.6.23-1.el7.x86_64
MySQL-server-advanced-5.6.23-1.el7.x86_64
MySQL-embedded-advanced-5.6.23-1.el7.x86_64
MySQL-shared-advanced-5.6.23-1.el7.x86_64
mysql-community-release-el7-5.noarch
MySQL-devel-advanced-5.6.23-1.el7.x86_64

6) Installation Layout for Linux RPM Packages.

 

<table border="1" summary="MySQL Installation Layout for Linux RPM Packages from the MySQL

Developer Zone”> Directory Contents of Directory /usr/bin Client programs and scripts /usr/sbin The mysqld server /var/lib/mysql Log files, databases /usr/share/info MySQL manual in Info format /usr/share/man Unix manual pages /usr/include/mysql Include (header) files /usr/lib/mysql Libraries /usr/share/mysql Miscellaneous support files, including error messages, character set files, sample configuration files, SQL for database installation /usr/share/sql-bench Benchmarks

How to Install MySQL on Unix/Linux Using Generic Binaries

Another way to Install MySQL on Unix/Linux.

1) Download “V74396-01.zip” which contains:

V74396-01

There are two files – ASC and MD5 for “mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz”.

a: Verify MD5 checksum:

$ cat mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz.md5
f2ace50e757f1a63736e8dcbf5cfeb19 mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

$ md5sum mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
f2ace50e757f1a63736e8dcbf5cfeb19 mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz

b) Signature Checking Using GnuPG.

To obtain a copy of our public GPG build key by copying or download from http://pgp.mit.edu/( The key is” mysql-build@oss.oracle.com”) to file mysql_pubkey.asc.

To import the build key into your personal public GPG keyring:

[root@racnote1 .gnupg]# gpg --import mysql_pubkey.asc
gpg: keyring `/root/.gnupg/secring.gpg' created
gpg: keyring `/root/.gnupg/pubring.gpg' created
gpg: /root/.gnupg/trustdb.gpg: trustdb created
gpg: key 5072E1F5: public key "MySQL Release Engineering <mysql-build@oss.oracle.com>" imported
gpg: Total number processed: 1
gpg: imported: 1
gpg: no ultimately trusted keys found
[root@racnote1 .gnupg]# ls -ltr
total 28
-rw-r--r--. 1 root root 5968 Mar 24 12:02 mysql_pubkey.asc
-rw-------. 1 root root 0 Mar 24 13:07 secring.gpg
-rw-------. 1 root root 4434 Mar 24 13:07 pubring.gpg~
-rw-------. 1 root root 4434 Mar 24 13:07 pubring.gpg
-rw-------. 1 root root 1200 Mar 24 13:07 trustdb.gpg

To  verify the signature for the distribution file:

[root@racnote1 Patches]# gpg --verify mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz.asc
gpg: Signature made Fri 30 Jan 2015 17:49:39 AEDT using DSA key ID 5072E1F5
gpg: Good signature from "MySQL Release Engineering <mysql-build@oss.oracle.com>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: A4A9 4068 76FC BD3C 4567 70C8 8C71 8D3B 5072 E1F5

2) Remove the previous MySQL installation.

a. Stop MySQL server

$service mysqld stop

b. Remove mysql-community-server and RPM packages.

[root@racnote1 Patches]# yum remove mysql-community-server
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: mysql-compat-server for package: akonadi-mysql-1.9.2-4.0.1.el7.x86_64
--> Running transaction check
---> Package akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 will be erased
--> Finished Dependency Resolution
adobe-linux-x86_64 | 951 B 00:00:00 
mysql-connectors-community/x86_64 | 2.5 kB 00:00:00 
mysql-tools-community/x86_64 | 2.5 kB 00:00:00 
mysql56-community/x86_64 | 2.5 kB 00:00:00 
ol7_UEKR3/x86_64 | 1.2 kB 00:00:00 
ol7_latest/x86_64 | 1.4 kB 00:00:00 
ol7_latest/x86_64/updateinfo | 349 kB 00:00:00 
ol7_latest/x86_64/primary | 8.4 MB 00:00:10 

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Removing:
 mysql-community-server x86_64 5.6.23-3.el7 @mysql56-community 244 M
Removing for dependencies:
 akonadi-mysql x86_64 1.9.2-4.0.1.el7 @ol7_latest 9.6 k

Transaction Summary
======================================================================================================================================================
Remove 1 Package (+1 Dependent package)

Installed size: 244 M
Is this ok [y/N]: Y 
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Erasing : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 1/2 
 Erasing : mysql-community-server-5.6.23-3.el7.x86_64 2/2 
 Verifying : mysql-community-server-5.6.23-3.el7.x86_64 1/2 
 Verifying : akonadi-mysql-1.9.2-4.0.1.el7.x86_64 2/2 

Removed:
 mysql-community-server.x86_64 0:5.6.23-3.el7 

Dependency Removed:
 akonadi-mysql.x86_64 0:1.9.2-4.0.1.el7 

Complete!


[root@racnote1 Patches]# rpm -qa |grep -i mysql
mysql-community-client-5.6.23-3.el7.x86_64
perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
qt-mysql-4.8.5-8.0.1.el7.x86_64
mysql-community-common-5.6.23-3.el7.x86_64
mysql-community-release-el7-5.noarch
mysql-community-libs-5.6.23-3.el7.x86_64

[root@racnote1 Patches]# yum remove mysql-community-common-5.6.23-3.el7.x86_64
Loaded plugins: langpacks
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.23-3.el7 for package: mysql-community-libs-5.6.23-3.el7.x86_64
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.23-3.el7 will be erased
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:net-snmp-5.7.2-18.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 1:qt-mysql-4.8.5-8.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18()(64bit) for package: 2:postfix-2.10.1-6.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: perl-DBD-MySQL-4.023-5.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 1:qt-mysql-4.8.5-8.0.1.el7.x86_64
--> Processing Dependency: libmysqlclient.so.18(libmysqlclient_18)(64bit) for package: 2:postfix-2.10.1-6.0.1.el7.x86_64
--> Processing Dependency: mysql-community-libs(x86-64) = 5.6.23-3.el7 for package: mysql-community-client-5.6.23-3.el7.x86_64
--> Processing Dependency: mysql-libs for package: 1:net-snmp-5.7.2-18.el7.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.23-3.el7 will be erased
---> Package net-snmp.x86_64 1:5.7.2-18.el7 will be erased
---> Package perl-DBD-MySQL.x86_64 0:4.023-5.0.1.el7 will be erased
---> Package postfix.x86_64 2:2.10.1-6.0.1.el7 will be erased
---> Package qt-mysql.x86_64 1:4.8.5-8.0.1.el7 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================
 Package Arch Version Repository Size
======================================================================================================================================================
Removing:
 mysql-community-common x86_64 5.6.23-3.el7 @mysql56-community 2.1 M
Removing for dependencies:
 mysql-community-client x86_64 5.6.23-3.el7 @mysql56-community 87 M
 mysql-community-libs x86_64 5.6.23-3.el7 @mysql56-community 9.1 M
 net-snmp x86_64 1:5.7.2-18.el7 @anaconda/7.0 850 k
 perl-DBD-MySQL x86_64 4.023-5.0.1.el7 @ol7_latest 323 k
 postfix x86_64 2:2.10.1-6.0.1.el7 @ol7_latest 12 M
 qt-mysql x86_64 1:4.8.5-8.0.1.el7 @ol7_latest 74 k

Transaction Summary
======================================================================================================================================================
Remove 1 Package (+6 Dependent packages)

Installed size: 112 M
Is this ok [y/N]: Y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
 Erasing : 1:net-snmp-5.7.2-18.el7.x86_64 1/7 
 Erasing : 2:postfix-2.10.1-6.0.1.el7.x86_64 2/7 
 Erasing : 1:qt-mysql-4.8.5-8.0.1.el7.x86_64 3/7 
 Erasing : mysql-community-client-5.6.23-3.el7.x86_64 4/7 
 Erasing : perl-DBD-MySQL-4.023-5.0.1.el7.x86_64 5/7 
 Erasing : mysql-community-libs-5.6.23-3.el7.x86_64 6/7 
 Erasing : mysql-community-common-5.6.23-3.el7.x86_64 7/7 
 Verifying : mysql-community-libs-5.6.23-3.el7.x86_64 1/7 
 Verifying : perl-DBD-MySQL-4.023-5.0.1.el7.x86_64 2/7 
 Verifying : mysql-community-client-5.6.23-3.el7.x86_64 3/7 
 Verifying : 1:qt-mysql-4.8.5-8.0.1.el7.x86_64 4/7 
 Verifying : 2:postfix-2.10.1-6.0.1.el7.x86_64 5/7 
 Verifying : 1:net-snmp-5.7.2-18.el7.x86_64 6/7 
 Verifying : mysql-community-common-5.6.23-3.el7.x86_64 7/7 

Removed:
 mysql-community-common.x86_64 0:5.6.23-3.el7 

Dependency Removed:
 mysql-community-client.x86_64 0:5.6.23-3.el7 mysql-community-libs.x86_64 0:5.6.23-3.el7 net-snmp.x86_64 1:5.7.2-18.el7 
 perl-DBD-MySQL.x86_64 0:4.023-5.0.1.el7 postfix.x86_64 2:2.10.1-6.0.1.el7 qt-mysql.x86_64 1:4.8.5-8.0.1.el7 

Complete!
[root@racnote1 Patches]# rpm -qa |grep -i mysql
mysql-community-release-el7-5.noarch

c. Stopping YUM from receiving  MySQL packages from  Third-Party, Nonnative Repositories.

 # view /etc/yum.repos.d/mysql-community.repo
# yum-config-manager --disable mysql-tools-community
# yum-config-manager --disable mysql-connectors-community
# yum-config-manager --disable mysql56-community

d. Check and delete /etc/my.cnf or  /etc/mysql files if any.

3) Install MySQL by unpacking the distribution.

#cd /usr/local
#tar zxvf /media/sf_Oracle12102/Patches/mysql-advanced-5.6.23-linux-glibc2.5-x86_64.tar.gz
# ln -s mysql-advanced-5.6.23-linux-glibc2.5-x86_64 mysql
# cd mysql
# chown -R mysql .
# chgrp -R mysql .
#scripts/mysql_install_db --user=mysql
# chown -R root .
#chown -R mysql data
# bin/mysqld_safe --user=mysql &
[1] 3492
[root@racnote1 mysql]# 150324 16:33:40 mysqld_safe Logging to '/usr/local/mysql/data/racnote1.err'.
150324 16:33:40 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

#cp support-files/mysql.server /etc/init.d/mysql.server

MySQL Installation Layout for Generic Unix/Linux Binary Package
DirectoryContents of Directory
bin,scriptsmysqld server, client and utility programs
dataLog files, databases
docsMySQL manual in Info format
manUnix manual pages
includeInclude (header) files
libLibraries
shareMiscellaneous support files, including error messages, sample configuration files, SQL for database installation
sql-benchBenchmarks

4) Perform Post-installation Set-up as per installation doc.